From patchwork Sun Mar 13 14:47:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 550922 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6713:0:0:0:0 with SMTP id u19csp1826093mag; Sun, 13 Mar 2022 07:49:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjmQ+RI/vHo4mA0xM+XlWLw8w3nlYbT0Cv9OHeLN0qNXkFVjZWSnm/NxmvCU9E+CIuDL6k X-Received: by 2002:a05:6402:909:b0:416:6f3c:5c1d with SMTP id g9-20020a056402090900b004166f3c5c1dmr16692533edz.108.1647182965948; Sun, 13 Mar 2022 07:49:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647182965; cv=none; d=google.com; s=arc-20160816; b=EooIV5nUJt7L+WDD05yAN8tW9WwXPFx7g5eu3CfoBJ1BhCy+yOzcJfWhKkLPdS0g+B sHkL8TsRryNCFhvJXQdjUs5uccTCp/vAUcx+U2bITrqBUF+JW4+bqBlFf4EbxGhzGntg rS5GWXnqcAMLAl1kGZWT1dYAgs8WGyBvC4TiLXRdVmg3kBSdTNRtC2IqjxImI73fKleE U85OPALeHf8VH7x//LDUzEe41q991ZlJ5S1KBZxrR0tk3B8f1ZLNdCTlhamRKZ1vKSTX PEwMdKAqsmapQaR5eZCcdfaPlOIcQkYKiciQZ9gI+dYXE44QDms6pClCSgc8+Cmup9AN swEw== 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=4MT1+LgYwO4bTNM9s65DYDNcD7QdzhnDDrbZFjYBd+Y=; b=ahyIv4KNTBsPmdaDcJkPoPkZH3hr6WsGfbXacpYYTn+ntcmHC7jI6mGY6XiYB58wFa so8Qk6gTd1nJ7UWawLohSJ+PD5j/W4lAPkykbFssDNy+zoblMcNO2QdtI7uu7Y9K4KJN pEqIqTCUOy/PAhj0cXVNqvpkYwgnIEiP1r0aViZ3l/JSTbfST22/16Ox0W4zIV6Q0FlZ HMSyOwfhzc8tVJ5AzPlcmmFleKPllfFki4aml5NSb2NQlHd4K9Eqr16s90B6ljQo3ZSd QPtXBvNGGbKguhw70dNeZObfObnaEoKDjQLKm81BzbM7ryyk3vnHoAyHJEw28gV8odGn 8CyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id v8-20020a056402348800b004186fee5d08si2031455edc.253.2022.03.13.07.49.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Mar 2022 07:49:25 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 5285883B13; Sun, 13 Mar 2022 15:49:20 +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 8C18E8339D; Sun, 13 Mar 2022 15:48: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=-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 06E8980F47 for ; Sun, 13 Mar 2022 15:48:52 +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 7455E1042; Sun, 13 Mar 2022 07:48:51 -0700 (PDT) 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 A8FF33F7D7; Sun, 13 Mar 2022 07:48:49 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Simon Glass , Heinrich Schuchardt , Sughosh Ganu Subject: [PATCH v5 2/9] tpm: Fix the return type of tpm_startup Date: Sun, 13 Mar 2022 20:17:55 +0530 Message-Id: <20220313144802.65687-3-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220313144802.65687-1-sughosh.ganu@linaro.org> References: <20220313144802.65687-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: Ilias Apalodimas Reviewed-by: Simon Glass --- Changes since V4: None include/tpm_api.h | 2 +- lib/tpm_api.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/tpm_api.h b/include/tpm_api.h index 249a966942..4d77a49719 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 7d26ea2c3a..da48058abe 100644 --- a/lib/tpm_api.c +++ b/lib/tpm_api.c @@ -11,7 +11,8 @@ #include #include -u32 tpm_startup(struct udevice *dev, enum tpm_startup_type mode) + +int tpm_startup(struct udevice *dev, enum tpm_startup_type mode) { if (tpm_is_v1(dev)) { return tpm1_startup(dev, mode);