From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 957A6C433F5 for ; Wed, 9 Mar 2022 07:37:05 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E4A978380F; Wed, 9 Mar 2022 08:37:02 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="pgLejPwm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4892983829; Wed, 9 Mar 2022 08:37:00 +0100 (CET) Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) (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 968B782F5E for ; Wed, 9 Mar 2022 08:36:56 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-ej1-x62b.google.com with SMTP id p15so2965199ejc.7 for ; Tue, 08 Mar 2022 23:36:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=bPZBHNQbJyWRYGeuxSPgWPo+eiUntDwGm2xxloq8ezE=; b=pgLejPwmSZOPTeW53WITLXKkEhX36KfPDNmG4zhJqSf7ESTTLaIACEwXW7w9JSmIUr MqvS87y7jE3PgprlE/0G4uy1heeDmSNtpQdIgGETShHUVHIvlMnFfbKKb4D+yP1eZ8p3 czTOy645vYMcSRzneViihsxOBsP2K+nwGi6HOS5/wxfanWpQUilLTIGUNGN2idQj/L1K UonwxdFbemkbJOeSLIJXZEKoxeFg/VBx0m340jS7J4WbpkfcdvzWYQ36Uqlms4/AgS0R l8kzmzCNVJ151CpnVGliKNjz9Gw0wAGqc5Idcc2qdOwvO2ZaayLZbBR6MFVCyHqdF4OC P8KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=bPZBHNQbJyWRYGeuxSPgWPo+eiUntDwGm2xxloq8ezE=; b=6GedO8LVWW8kNFcBYJT1C/eCEVzmsMm8jwlqxviD5J2eCpQKtCPD9fPfPhlmiFum15 DxjS2aa8wO/K/878QSYgdOlmmEYrOZlpUPT39ZCTgAKr0RdeJaRuAqCbpzodiUXN1Q0x ynvGLRKwoK8RyyXeD80JtRrWHMAu6MQg3UEXtT35+hNG3MLI6lZAm4EWgAbiApKtsHWn YK6Or8I20M+XpBtCuBjgWHn9IyFUektIamotOtlXsNcpKOm+IhKlEq7c4huwbxNvYlce xU9yuuv0axKABmd+C1AwEDdN5gEY1u4x7TyuNHEERsLef4hdkWGCQidKDU70DkFyCkdx GuUQ== X-Gm-Message-State: AOAM530V3bQXWDsxNDYbF35/1ZQ2Msl7DdF/yrwv8ovLaKrHiHcBI1mP 6R/VfnL9CxjqNFDSkeL1G/oOGtdTnTdkGQ== X-Google-Smtp-Source: ABdhPJwQ+kHlwNc7wSsf3bRwdDsH8FFwSohugjp25iF+T/Gr4myqtRHumD3HZpIbfKtBsWEtctCVFg== X-Received: by 2002:a17:906:3fd4:b0:6da:8ab0:a882 with SMTP id k20-20020a1709063fd400b006da8ab0a882mr15936280ejj.572.1646811416210; Tue, 08 Mar 2022 23:36:56 -0800 (PST) Received: from hades (athedsl-4461682.home.otenet.gr. [94.71.4.98]) by smtp.gmail.com with ESMTPSA id bx1-20020a0564020b4100b00410f01a91f0sm433856edb.73.2022.03.08.23.36.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 23:36:55 -0800 (PST) Date: Wed, 9 Mar 2022 09:36:53 +0200 From: Ilias Apalodimas To: Sughosh Ganu Cc: u-boot@lists.denx.de, Simon Glass , Heinrich Schuchardt Subject: Re: [PATCH v3 1/8] tpm: rng: Change tpm_get_random to return an int Message-ID: References: <20220304133429.1047752-1-sughosh.ganu@linaro.org> <20220304133429.1047752-2-sughosh.ganu@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220304133429.1047752-2-sughosh.ganu@linaro.org> 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 On Fri, Mar 04, 2022 at 07:04:22PM +0530, Sughosh Ganu wrote: > The tpm random number generation functionality will be moved to the > driver model. With that, the tpm_get_random function will call the > common driver model api instead of separate functions for tpmv1 and > tpmv2. Return an int instead of a u32 to comply with the return value > of the driver model function. > > Signed-off-by: Sughosh Ganu > Reviewed-by: Heinrich Schuchardt > Reviewed-by: Simon Glass > --- > > Changes since V2: None > > include/tpm_api.h | 4 ++-- > lib/tpm_api.c | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/include/tpm_api.h b/include/tpm_api.h > index 11aa14eb79..249a966942 100644 > --- a/include/tpm_api.h > +++ b/include/tpm_api.h > @@ -274,9 +274,9 @@ u32 tpm_find_key_sha1(struct udevice *dev, const u8 auth[20], > * @param dev TPM device > * @param data output buffer for the random bytes > * @param count size of output buffer > - * Return: return code of the operation > + * Return: 0 if OK, -ve on error > */ > -u32 tpm_get_random(struct udevice *dev, void *data, u32 count); > +int tpm_get_random(struct udevice *dev, void *data, u32 count); > > /** > * tpm_finalise_physical_presence() - Finalise physical presence > diff --git a/lib/tpm_api.c b/lib/tpm_api.c > index 4ac4612c81..7d26ea2c3a 100644 > --- a/lib/tpm_api.c > +++ b/lib/tpm_api.c > @@ -264,7 +264,7 @@ u32 tpm_get_permissions(struct udevice *dev, u32 index, u32 *perm) > return -ENOSYS; > } > > -u32 tpm_get_random(struct udevice *dev, void *data, u32 count) > +int tpm_get_random(struct udevice *dev, void *data, u32 count) > { > if (tpm_is_v1(dev)) > return tpm1_get_random(dev, data, count); > -- > 2.25.1 > Reviewed-by: Ilias Apalodimas