[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3f540748-8d17-46bf-b613-9caae597a926@arm.com>
Date: Mon, 17 Feb 2025 09:54:09 -0600
From: Stuart Yoder <stuart.yoder@....com>
To: Jarkko Sakkinen <jarkko@...nel.org>
Cc: linux-integrity@...r.kernel.org, peterhuewe@....de, jgg@...pe.ca,
sudeep.holla@....com, rafael@...nel.org, lenb@...nel.org,
linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 2/5] tpm_crb: refactor check for idle support into TPM
into inline function
On 2/14/25 2:18 AM, Jarkko Sakkinen wrote:
> On Thu, Feb 13, 2025 at 06:27:42PM -0600, Stuart Yoder wrote:
>> Refactor the two checks for whether the TPM supports idle into a single
>> inline function.
>>
>> Signed-off-by: Stuart Yoder <stuart.yoder@....com>
>> ---
>> drivers/char/tpm/tpm_crb.c | 18 ++++++++++++------
>> 1 file changed, 12 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c
>> index ea085b14ab7c..d696226906a2 100644
>> --- a/drivers/char/tpm/tpm_crb.c
>> +++ b/drivers/char/tpm/tpm_crb.c
>> @@ -115,6 +115,16 @@ struct tpm2_crb_pluton {
>> u64 reply_addr;
>> };
>>
>> +static inline bool tpm_crb_has_idle(u32 start_method)
>> +{
>> + if ((start_method == ACPI_TPM2_START_METHOD) ||
>
> Unnecessary parentheses in each condition.
>
>> + (start_method == ACPI_TPM2_COMMAND_BUFFER_WITH_START_METHOD) ||
>> + (start_method == ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC))
>> + return false;
>> + else
>> + return true;
>> +}
>
> Could be just plain
>
> /*
> * Returns true, if the start method supports idle.
> */
> static inline bool tpm_crb_has_idle(u32 start_method)
> {
> return start_method == ACPI_TPM2_START_METHOD ||
> start_method == ACPI_TPM2_COMMAND_BUFFER_WITH_START_METHOD ||
> start_method == ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC;
> }
Will do that cleanup.
Thanks,
Stuart
Powered by blists - more mailing lists