From patchwork Wed Mar 9 12:27:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 549705 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6713:0:0:0:0 with SMTP id u19csp3514529mag; Wed, 9 Mar 2022 04:29:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJwf9J1jzm0eUk72sNxUUSk6t1rqV4gnoYCcA1L8GlwMMkutZYLUP2Q9f6YPI6hz6dIRNmld X-Received: by 2002:a17:907:6d9f:b0:6db:62b6:f3d6 with SMTP id sb31-20020a1709076d9f00b006db62b6f3d6mr3728248ejc.366.1646828966118; Wed, 09 Mar 2022 04:29:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646828966; cv=none; d=google.com; s=arc-20160816; b=iDYS6dJrHgn/LGYVqAS8RgmP/zlgBwrbs+6vJ95dvLv1g68EUkKgngGtngDAKp6KEN iW0w9vFTq3nn7dIPFD/hCxdUEa4icU2DMIHXbzSWjJ1mXV9mzHjxee3Fk4o1ppl4/LLx RerwlxBSHM6my+2Ih8fa9rpCmIVaIg8V2WGzJwzJls67KQOmgVFW7gcOjQ6fnoHAbApf fF/x1iH0P4p0HOZvLQIdBh1KvTF/ixprvspT+YP6ccqemYo22YQiP58lU6ReKGxmgpAC WP4m4By6lBzU9ElL05vMRVrC+3uYOyFvmGsWjLNkHtcjdg7A3joTjYNgqVYirrZ8Bxac 56KA== 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=YBHFQOVKR7Ihcb3By3H7rNB8sXD20p1uBj2P9/aQmL0=; b=qtnXF3MSLZx1rwFmDB7jkcK2tlgCF3YNqcATxswNOTtPcIu7D7eXhM0dM7qbFjIVAo etb2ZtwbrcTsVzSxM+YfRXYJonPxA+oo407xnPbNyaOTf0qaYQ83T9C7RvJBu2LkZFOk fU+Xw9xUkJE3PCpJoCqRUDTjYVQrsKkL9wihtQJkdMriyif9MDb18QyosLdtZxqoFAXW tasRVEBJIqOKgTr4QIttD+kH6mGucIPX8WjNdhCI1eHg2Ex2arnLr3pb7V4awpghqN/R EByAfornC16xPecWmKhq199es97j+Tz2OH2LvP+r76gbYlu7ZGIOZpNL6IWV/qLupVgi PyBw== 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 y11-20020aa7ce8b000000b0041602cd7e3fsi1161813edv.552.2022.03.09.04.29.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Mar 2022 04:29:26 -0800 (PST) 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 37D7283981; Wed, 9 Mar 2022 13:29:22 +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 2796A8397F; Wed, 9 Mar 2022 13:28:44 +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 A6B1183829 for ; Wed, 9 Mar 2022 13:28:37 +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 214551688; Wed, 9 Mar 2022 04:28:37 -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 551643FA4D; Wed, 9 Mar 2022 04:28:35 -0800 (PST) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Simon Glass , Heinrich Schuchardt , Sughosh Ganu Subject: [PATCH v4 2/8] tpm: Fix the return type of tpm_startup Date: Wed, 9 Mar 2022 17:57:54 +0530 Message-Id: <20220309122800.3940001-3-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220309122800.3940001-1-sughosh.ganu@linaro.org> References: <20220309122800.3940001-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 V3: 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);