Re: [PATCH v2] tpm: disable hwrng for fTPM on some AMD designs

Guenter Roeck
2023-02-27T15:06:35Z

On 2/27/23 06:58, Mario Limonciello wrote:
[ ... ]
>>> +    version = ((u64)val1 << 32) | val2;
>>> +    if ((version >> 48) == 6) {
>>> +        if (version >= 0x0006000000180006ULL)
>>> +            return false;
>>> +    } else if ((version >> 48) == 3) {
>>> +        if (version >= 0x0003005700000005ULL)
>>> +            return false;
>>> +    } else
>>> +        return false;
>>
>> checkpatch:
>>
>> CHECK: braces {} should be used on all arms of this statement
>> #200: FILE: drivers/char/tpm/tpm-chip.c:557:
>> +    if ((version >> 48) == 6) {
>> [...]
>> +    } else if ((version >> 48) == 3) {
>> [...]
>> +    } else
>> [...]
>
> It was requested by Jarko explicitly in v1 to do it this way.
>
> https://lore.kernel.org/lkml/Y+%2F6G+UlTI7GpW6o@kernel.org/
>

Interesting. We live and learn.

Guenter