Re: [PATCH 1/3] common/kernel: address violation of MISRA C Rule 13.6

2024-06-26 Thread Alessandro Zucchelli
On 2024-06-26 03:13, Stefano Stabellini wrote: Hi, On Tue, 25 Jun 2024, Jan Beulich wrote: On 25.06.2024 12:14, Alessandro Zucchelli wrote: > --- a/xen/common/kernel.c > +++ b/xen/common/kernel.c > @@ -660,14 +660,15 @@ long do_xen_version(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg) > > ca

Re: [PATCH 1/3] common/kernel: address violation of MISRA C Rule 13.6

2024-06-25 Thread Stefano Stabellini
On Tue, 25 Jun 2024, Jan Beulich wrote: > On 25.06.2024 12:14, Alessandro Zucchelli wrote: > > --- a/xen/common/kernel.c > > +++ b/xen/common/kernel.c > > @@ -660,14 +660,15 @@ long do_xen_version(int cmd, > > XEN_GUEST_HANDLE_PARAM(void) arg) > > > > case XENVER_guest_handle: > > { >

Re: [PATCH 1/3] common/kernel: address violation of MISRA C Rule 13.6

2024-06-25 Thread Jan Beulich
On 25.06.2024 12:14, Alessandro Zucchelli wrote: > --- a/xen/common/kernel.c > +++ b/xen/common/kernel.c > @@ -660,14 +660,15 @@ long do_xen_version(int cmd, > XEN_GUEST_HANDLE_PARAM(void) arg) > > case XENVER_guest_handle: > { > +struct domain *d = current->domain; Can a (new

[PATCH 1/3] common/kernel: address violation of MISRA C Rule 13.6

2024-06-25 Thread Alessandro Zucchelli
In the file common/kernel.c macro ARRAY_SIZE is called with argument current->domain->handle. Once expanded, this ARRAY_SIZE's argument is used in sizeof operations and thus 'current', being a macro that expands to a function call with potential side effects, generates a violation. To address this