On 03.09.2026 00:51, Teddy Astie wrote:
> Le 03/09/2026 à 00:14, Andrew Cooper a écrit :
>> @@ -273,6 +274,35 @@ static bool microcode_fits_cpu(const struct
>> microcode_patch *mc)
>> return false;
>> }
>>
>> +static bool microcode_safe_to_load(const struct microcode_patch *mc)
>> +{
>> + struct cpu_signature *cpu_sig = &this_cpu(cpu_sig);
>> +
>> + /*
>> + * Treat pre-production as always safe - anyone using pre-production
>> + * microcode knows what they are doing, and can keep any resulting
>> pieces.
>> + */
>> + if ( cpu_sig->rev < 0 || mc->rev < 0 )
>
> cpu_sig->rev can't be negative as it's unsigned int.
With that I'm surprised the compiler doesn't flag this as "condition is
always false" or alike. Surely Misra isn't going to like it either.
Jan