[XEN PATCH 0/4] address violations of MISRA C Rule 20.7

Nicola Vetrini posted 4 patches 6 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/cover.1715757982.git.nicola.vetrini@bugseng.com
There is a newer version of this series
xen/arch/x86/cpu/vpmu_amd.c               | 4 ++--
xen/arch/x86/hvm/mtrr.c                   | 2 +-
xen/arch/x86/hvm/rtc.c                    | 2 +-
xen/arch/x86/include/asm/hvm/save.h       | 2 +-
xen/arch/x86/include/asm/x86_64/uaccess.h | 7 ++++---
xen/arch/x86/x86_64/cpu_idle.c            | 2 +-
6 files changed, 10 insertions(+), 9 deletions(-)
[XEN PATCH 0/4] address violations of MISRA C Rule 20.7
Posted by Nicola Vetrini 6 months, 1 week ago
Hi all,

this series aims to refactor some macros that cause violations of MISRA C Rule
20.7 ("Expressions resulting from the expansion of macro parameters shall be
enclosed in parentheses"). All the macros touched by these patches are in some
way involved in violations, and the strategy adopted to bring them into
compliance is to add parentheses around macro arguments where needed.

Nicola Vetrini (4):
  x86/vpmu: address violations of MISRA C Rule 20.7
  x86/hvm: address violations of MISRA C Rule 20.7
  x86_64/uaccess: address violations of MISRA C Rule 20.7
  x86_64/cpu_idle: address violations of MISRA C Rule 20.7

 xen/arch/x86/cpu/vpmu_amd.c               | 4 ++--
 xen/arch/x86/hvm/mtrr.c                   | 2 +-
 xen/arch/x86/hvm/rtc.c                    | 2 +-
 xen/arch/x86/include/asm/hvm/save.h       | 2 +-
 xen/arch/x86/include/asm/x86_64/uaccess.h | 7 ++++---
 xen/arch/x86/x86_64/cpu_idle.c            | 2 +-
 6 files changed, 10 insertions(+), 9 deletions(-)

-- 
2.34.1
Re: [XEN PATCH 0/4] address violations of MISRA C Rule 20.7
Posted by Jan Beulich 6 months, 1 week ago
Oleksii,

On 15.05.2024 09:34, Nicola Vetrini wrote:
> Hi all,
> 
> this series aims to refactor some macros that cause violations of MISRA C Rule
> 20.7 ("Expressions resulting from the expansion of macro parameters shall be
> enclosed in parentheses"). All the macros touched by these patches are in some
> way involved in violations, and the strategy adopted to bring them into
> compliance is to add parentheses around macro arguments where needed.
> 
> Nicola Vetrini (4):
>   x86/vpmu: address violations of MISRA C Rule 20.7
>   x86/hvm: address violations of MISRA C Rule 20.7
>   x86_64/uaccess: address violations of MISRA C Rule 20.7
>   x86_64/cpu_idle: address violations of MISRA C Rule 20.7

for 4.18 we took a relaxed approach towards (simple) changes for Misra purposes.
I wonder whether you mean to permit the same for 4.19, or whether series like
this one rather want/need delaying until after branching.

Jan

>  xen/arch/x86/cpu/vpmu_amd.c               | 4 ++--
>  xen/arch/x86/hvm/mtrr.c                   | 2 +-
>  xen/arch/x86/hvm/rtc.c                    | 2 +-
>  xen/arch/x86/include/asm/hvm/save.h       | 2 +-
>  xen/arch/x86/include/asm/x86_64/uaccess.h | 7 ++++---
>  xen/arch/x86/x86_64/cpu_idle.c            | 2 +-
>  6 files changed, 10 insertions(+), 9 deletions(-)
>
Re: [XEN PATCH 0/4] address violations of MISRA C Rule 20.7
Posted by Oleksii K. 6 months, 1 week ago
On Wed, 2024-05-15 at 09:48 +0200, Jan Beulich wrote:
> Oleksii,
> 
> On 15.05.2024 09:34, Nicola Vetrini wrote:
> > Hi all,
> > 
> > this series aims to refactor some macros that cause violations of
> > MISRA C Rule
> > 20.7 ("Expressions resulting from the expansion of macro parameters
> > shall be
> > enclosed in parentheses"). All the macros touched by these patches
> > are in some
> > way involved in violations, and the strategy adopted to bring them
> > into
> > compliance is to add parentheses around macro arguments where
> > needed.
> > 
> > Nicola Vetrini (4):
> >   x86/vpmu: address violations of MISRA C Rule 20.7
> >   x86/hvm: address violations of MISRA C Rule 20.7
> >   x86_64/uaccess: address violations of MISRA C Rule 20.7
> >   x86_64/cpu_idle: address violations of MISRA C Rule 20.7
> 
> for 4.18 we took a relaxed approach towards (simple) changes for
> Misra purposes.
> I wonder whether you mean to permit the same for 4.19, or whether
> series like
> this one rather want/need delaying until after branching.
Lets follow the same approach for 4.19.

Sorry for delayed answer.

~ Oleksii

> 
> Jan
> 
> >  xen/arch/x86/cpu/vpmu_amd.c               | 4 ++--
> >  xen/arch/x86/hvm/mtrr.c                   | 2 +-
> >  xen/arch/x86/hvm/rtc.c                    | 2 +-
> >  xen/arch/x86/include/asm/hvm/save.h       | 2 +-
> >  xen/arch/x86/include/asm/x86_64/uaccess.h | 7 ++++---
> >  xen/arch/x86/x86_64/cpu_idle.c            | 2 +-
> >  6 files changed, 10 insertions(+), 9 deletions(-)
> > 
> 
Re: [XEN PATCH 0/4] address violations of MISRA C Rule 20.7
Posted by Jan Beulich 6 months, 1 week ago
On 16.05.2024 17:58, Oleksii K. wrote:
> On Wed, 2024-05-15 at 09:48 +0200, Jan Beulich wrote:
>> On 15.05.2024 09:34, Nicola Vetrini wrote:
>>> this series aims to refactor some macros that cause violations of
>>> MISRA C Rule
>>> 20.7 ("Expressions resulting from the expansion of macro parameters
>>> shall be
>>> enclosed in parentheses"). All the macros touched by these patches
>>> are in some
>>> way involved in violations, and the strategy adopted to bring them
>>> into
>>> compliance is to add parentheses around macro arguments where
>>> needed.
>>>
>>> Nicola Vetrini (4):
>>>   x86/vpmu: address violations of MISRA C Rule 20.7
>>>   x86/hvm: address violations of MISRA C Rule 20.7
>>>   x86_64/uaccess: address violations of MISRA C Rule 20.7
>>>   x86_64/cpu_idle: address violations of MISRA C Rule 20.7
>>
>> for 4.18 we took a relaxed approach towards (simple) changes for
>> Misra purposes.
>> I wonder whether you mean to permit the same for 4.19, or whether
>> series like
>> this one rather want/need delaying until after branching.
> Lets follow the same approach for 4.19.

Well, okay. But if you don't say now until when this is okay, you'll
need to announce the "stop" very prominently later on, so no-one
misses it.

Jan

Re: [XEN PATCH 0/4] address violations of MISRA C Rule 20.7
Posted by Oleksii K. 6 months, 1 week ago
On Thu, 2024-05-16 at 18:08 +0200, Jan Beulich wrote:
> > > for 4.18 we took a relaxed approach towards (simple) changes for
> > > Misra purposes.
> > > I wonder whether you mean to permit the same for 4.19, or whether
> > > series like
> > > this one rather want/need delaying until after branching.
> > Lets follow the same approach for 4.19.
> 
> Well, okay. But if you don't say now until when this is okay, you'll
> need to announce the "stop" very prominently later on, so no-one
> misses it.
For me it is okay until we don't have Hard Code Release deadline.

~ Oleksii