From patchwork Sun Jan 12 19:06:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1221862 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=CJh1i4ZG; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47wmYj72zWz9sPW for ; Mon, 13 Jan 2020 06:12:09 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 642EB81841; Sun, 12 Jan 2020 20:08:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="CJh1i4ZG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2AD0E81830; Sun, 12 Jan 2020 20:07:57 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D959F8182A for ; Sun, 12 Jan 2020 20:07:53 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x142.google.com with SMTP id x5so6057338ila.6 for ; Sun, 12 Jan 2020 11:07:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=z+uStdwcxHckP/aCDkWNP/19UjyvFBFB1evLtEwhJWc=; b=CJh1i4ZGjDjEbQvX3QQyrm7Qlq1fFjFF9sBlzpEsyINVudItqGGvOHO06RRTt0NrDe SLP44HzvvYD48WBWeL4qL88IePlSJXMkE20O5+iFFqFNhYYwX//ESHDc2lztbpnLQXcy 1nhw/xV8OEfIu6FkDzRLZLDWvZU2wcTDDK+yM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=z+uStdwcxHckP/aCDkWNP/19UjyvFBFB1evLtEwhJWc=; b=goXAZ/w/PJGtwynFXIlvK+EFpMYvawW7TzAHRcZirX/GMqxhXlASf1kupRZUXRd/4+ c1abvv1rAedZY/p4+VdFog+121hXKUa3oFXNmEzkglzmQYa3XSnngnUVBi0xg18V/L7S 429f3aWop+t1OttnPVJlMRbd+3MCCgMdPxzssDSjFkQeNyv6JqAJeLjelkd6mcKFI71T vxTUMtLWrpdUbQTdpqFtPR+zTA41cM2eQGuCzCDMZaMqKLa4vs0mMZUPiIzBHVcWUUQS 8kMfzXj0lMa0HdkV7gIUdC32uaYNCAQf7PvJHka8AYUvRXXTIa1CpylIPndpmJpluXzN RKfw== X-Gm-Message-State: APjAAAUGQtQBLmtagrj+1GCLQrGA/CnzD77XLVZxqBeB9xIQHUZbmXA+ /6MzJ5LA3abpcjN20lQGn2oGpnAYQl0= X-Google-Smtp-Source: APXvYqzmAWagnuME2aBQBLK6Gy0wCXdR2inp407/0x1hD2klnxX3f2oCF/h94Q9L4kimAptumCutsg== X-Received: by 2002:a92:5d8d:: with SMTP id e13mr11421064ilg.285.1578856072731; Sun, 12 Jan 2020 11:07:52 -0800 (PST) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id r22sm3039219ilb.25.2020.01.12.11.07.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2020 11:07:52 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Subject: [PATCH 32/33] sandbox: Complete migration away from os_malloc() Date: Sun, 12 Jan 2020 12:06:23 -0700 Message-Id: <20200112120216.32.I98bcf2c9d3516b00a2b4205dc94e7eb330ff6cfd@changeid> X-Mailer: git-send-email 2.25.0.rc1.283.g88dfdc4193-goog In-Reply-To: <20200112190624.79077-1-sjg@chromium.org> References: <20200112190624.79077-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.101.4 at phobos.denx.de X-Virus-Status: Clean Now that we can use direct access to the system malloc() in sandbox, drop the remaining uses of os_malloc(). The only one remaining now is for the RAM buffer, which we do want to be at a known adress, so this is intended. Signed-off-by: Simon Glass --- drivers/misc/cros_ec_sandbox.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/misc/cros_ec_sandbox.c b/drivers/misc/cros_ec_sandbox.c index 4fcb2d96f5..9dd6a18b2b 100644 --- a/drivers/misc/cros_ec_sandbox.c +++ b/drivers/misc/cros_ec_sandbox.c @@ -11,10 +11,10 @@ #include #include #include -#include #include #include #include +#include #include #include #include @@ -115,7 +115,7 @@ static int cros_ec_read_state(const void *blob, int node) prop = fdt_getprop(blob, node, "flash-data", &len); if (prop) { ec->flash_data_len = len; - ec->flash_data = os_malloc(len); + ec->flash_data = malloc(len); if (!ec->flash_data) return -ENOMEM; memcpy(ec->flash_data, prop, len); @@ -545,14 +545,14 @@ int cros_ec_probe(struct udevice *dev) ec->flash_data_len != ec->ec_config.flash.length) { printf("EC data length is %x, expected %x, discarding data\n", ec->flash_data_len, ec->ec_config.flash.length); - os_free(ec->flash_data); + free(ec->flash_data); ec->flash_data = NULL; } /* Otherwise allocate the memory */ if (!ec->flash_data) { ec->flash_data_len = ec->ec_config.flash.length; - ec->flash_data = os_malloc(ec->flash_data_len); + ec->flash_data = malloc(ec->flash_data_len); if (!ec->flash_data) return -ENOMEM; }