On 20/02/2026 10:45 pm, Nicola Vetrini wrote:
> On 2026-02-20 22:46, Andrew Cooper wrote:
>> Fixing Rule 20.7 violations.
>>
>> No functional change.
>>
>> Signed-off-by: Andrew Cooper <[email protected]>
>
> Reviewed-by: Nicola Vetrini <[email protected]>

Thanks.

>> diff --git a/xen/common/livepatch.c b/xen/common/livepatch.c
>> index 7446533c8cfb..63473925cafb 100644
>> --- a/xen/common/livepatch.c
>> +++ b/xen/common/livepatch.c
>> @@ -664,9 +664,10 @@ static inline int
>> livepatch_check_expectations(const struct payload *payload)
>>      const struct livepatch_elf_sec *__sec =
>> livepatch_elf_sec_by_name(elf, section_name); \
>>      if ( !__sec
>> )                                                     
>>                    \
>>         
>> break;                                                        
>>                    \
>> -    if ( !section_ok(elf, __sec, sizeof(*hook)) ||
>> __sec->sec->sh_size != sizeof(*hook) ) \
>> +    if ( !section_ok(elf, __sec, sizeof(*(hook)))
>> ||                                      \
>> +         __sec->sec->sh_size != sizeof(*(hook))
>> )                                         \
>>          return
>> -EINVAL;                                               
>>                    \
>> -    hook =
>> __sec->addr;                                               
>>                    \
>> +    (hook) =
>> __sec->addr;                                             
>>                    \
>
> This is not strictly needed, if not for consistency.

That explains why my first try didn't succeed.  But, why is it that only
MISRA only cares about bracketing for rvalues, not lvalues ?

~Andrew

Reply via email to