From patchwork Mon Feb 28 12:06:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 546689 Delivered-To: patch@linaro.org Received: by 2002:ac0:9f50:0:0:0:0:0 with SMTP id l16csp2675163imf; Mon, 28 Feb 2022 04:08:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJzKe6E7+gomfz0wHebjOcflH938iuykqqpOSUESnYiCXk/pVBre3bbWI31Dtf45YSKs4a3g X-Received: by 2002:a05:6402:2922:b0:40f:7241:74d4 with SMTP id ee34-20020a056402292200b0040f724174d4mr19427137edb.43.1646050093101; Mon, 28 Feb 2022 04:08:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646050093; cv=none; d=google.com; s=arc-20160816; b=cbElnSIS8rcLZ5E3q+/Czgbo6TzHrFMKhKpMriHV3G5Ocf9LjwQCa1yexbPV5E+Sua DBOB+snt1LljCT0cnew4B4zHOhTsxa9FTd5vTNPZipM5paK9Dsnctm5q9FLPw9wWf+Td 65YGakIDooZ691ND0pqwaF0b+sX+JWomklSlxVy8uaTwLAZhrZzTZOIkgILdMjXaCsPe 74wnsbdDJXe9ybpcwHjwdAILySuOLlwCp9hnTpDig1BRyJO6FdCCXHJAkXQDABDNT58W F35zMW3pd7yBQk5012XlePc3z4Xq+BgxjY/kicxd53hP8vmGoy2k+/aElg6bOSx+lStR iBlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=tSIXD+nDJIhtpHyDHMXcrtE9cSFjLIsQvVSihnzBiEc=; b=dFnAQKxO/0ljSRQuMx76mj/NVqCOvDpJ6ZHaSp0pe0mgBHVV73/PA0PPMU/V6CHqbK rd1m6NMm9//S2PAZJBm+FFE21YUB+9W+6b2KSRBDs2Txl2bdI1RD+d7NgrKLNefhRLkX W7H2Ct0EOnu0r5sJhtNPrsfiUze91J4LjOlhAq1PNXJSGgTPN+1qgbIUdyoQBv0x1RSH WEopr2eBJ0hEdzKe04zk9Kujl4I2mqnUdEgCNlbip3ljrzJpd2XpxIqPkbRINbCOrnXr uGDu1Ii9zS7b9CszroP1SLWssT37dEpgey96arCm+14rDB0Gy5HfGakMkXOh6v+2K5NT 5ebQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id g1-20020a1709065d0100b006b9106ceab4si9702343ejt.743.2022.02.28.04.08.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 04:08:13 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 54C2B83C29; Mon, 28 Feb 2022 13:08:05 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 9247D838D6; Mon, 28 Feb 2022 13:07:39 +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=-1.2 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id F2AFE83BCA for ; Mon, 28 Feb 2022 13:07:33 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2808BED1; Mon, 28 Feb 2022 04:07:33 -0800 (PST) Received: from a076522.blr.arm.com (a076522.blr.arm.com [10.162.16.44]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 430643F73D; Mon, 28 Feb 2022 04:07:31 -0800 (PST) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Simon Glass , Heinrich Schuchardt , Mario Six , Sughosh Ganu Subject: [PATCH v2 03/10] tpm: Fix the return type of tpm_startup Date: Mon, 28 Feb 2022 17:36:31 +0530 Message-Id: <20220228120638.678137-4-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220228120638.678137-1-sughosh.ganu@linaro.org> References: <20220228120638.678137-1-sughosh.ganu@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.5 at phobos.denx.de X-Virus-Status: Clean The tpm_startup function returns negative values for error conditions. Fix the return type of the function to a signed int instead of a u32. Signed-off-by: Sughosh Ganu Reviewed-by: Simon Glass --- Changes since V1: None include/tpm_api.h | 2 +- lib/tpm_api.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/tpm_api.h b/include/tpm_api.h index b9e3e8b5e6..fb6ee14e23 100644 --- a/include/tpm_api.h +++ b/include/tpm_api.h @@ -18,7 +18,7 @@ * @param mode TPM startup mode * Return: return code of the operation */ -u32 tpm_startup(struct udevice *dev, enum tpm_startup_type mode); +int tpm_startup(struct udevice *dev, enum tpm_startup_type mode); /** * Issue a TPM_SelfTestFull command. diff --git a/lib/tpm_api.c b/lib/tpm_api.c index 1bbe33a3fc..b762202866 100644 --- a/lib/tpm_api.c +++ b/lib/tpm_api.c @@ -21,7 +21,7 @@ static bool is_tpm2(struct udevice *dev) return IS_ENABLED(CONFIG_TPM_V2) && tpm_get_version(dev) == TPM_V2; } -u32 tpm_startup(struct udevice *dev, enum tpm_startup_type mode) +int tpm_startup(struct udevice *dev, enum tpm_startup_type mode) { if (is_tpm1(dev)) { return tpm1_startup(dev, mode);