From: Jan Beulich <jbeulich@suse.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org, consulting@bugseng.com,
Gianluca Luparini <gianluca.luparini@bugseng.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
George Dunlap <george.dunlap@citrix.com>,
Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>,
Michal Orzel <michal.orzel@amd.com>,
Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
Simone Ballarin <simone.ballarin@bugseng.com>
Subject: Re: [XEN PATCH v2 13/13] xen: fix violations of MISRA C:2012 Rule 7.2
Date: Thu, 6 Jul 2023 10:34:24 +0200 [thread overview]
Message-ID: <3696380a-b3f9-8fd3-a900-c15c6eea74f6@suse.com> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2307051646360.761183@ubuntu-linux-20-04-desktop>
On 06.07.2023 01:49, Stefano Stabellini wrote:
>> --- a/xen/include/xen/bitops.h
>> +++ b/xen/include/xen/bitops.h
>> @@ -227,11 +227,11 @@ static inline __u32 ror32(__u32 word, unsigned int shift)
>> }
>>
>> /* base-2 logarithm */
>> -#define __L2(_x) (((_x) & 0x00000002) ? 1 : 0)
>> -#define __L4(_x) (((_x) & 0x0000000c) ? ( 2 + __L2( (_x)>> 2)) : __L2( _x))
>> -#define __L8(_x) (((_x) & 0x000000f0) ? ( 4 + __L4( (_x)>> 4)) : __L4( _x))
>> -#define __L16(_x) (((_x) & 0x0000ff00) ? ( 8 + __L8( (_x)>> 8)) : __L8( _x))
>> -#define ilog2(_x) (((_x) & 0xffff0000) ? (16 + __L16((_x)>>16)) : __L16(_x))
>> +#define __L2(_x) (((_x) & 0x00000002U) ? 1 : 0)
>> +#define __L4(_x) (((_x) & 0x0000000cU) ? ( 2 + __L2( (_x)>> 2)) : __L2( _x))
>> +#define __L8(_x) (((_x) & 0x000000f0U) ? ( 4 + __L4( (_x)>> 4)) : __L4( _x))
>> +#define __L16(_x) (((_x) & 0x0000ff00U) ? ( 8 + __L8( (_x)>> 8)) : __L8( _x))
>> +#define ilog2(_x) (((_x) & 0xffff0000U) ? (16 + __L16((_x)>>16)) : __L16(_x))
>
> Jan, would you want to replace _x with x here as well?
Yes.
> If so, I think it would be best if done in a separate patch (keep
> mechanical changes mechanical) and keep this patch as is:
It was done in one go in patch 9, so I don't see why doing it here
as well would do any harm. Additionally missing blanks before >>
should be inserted at this occasion, and perhaps excess ones dropped
from the first of the changed lines (or further ones added to align
toe colons). While with that the lines still stay just below the 80
chars limit, dropping the leading underscores would get us a little
father away from that boundary.
Jan
next prev parent reply other threads:[~2023-07-06 8:35 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-05 15:26 [XEN PATCH v2 00/13] xen: fix violations of MISRA C:2012 Rule 7.2 Simone Ballarin
2023-07-05 15:26 ` [XEN PATCH v2 01/13] x86/cpufreq: " Simone Ballarin
2023-07-05 23:29 ` Stefano Stabellini
2023-07-06 7:44 ` Jan Beulich
2023-07-05 15:26 ` [XEN PATCH v2 02/13] AMD/IOMMU: " Simone Ballarin
2023-07-05 23:31 ` Stefano Stabellini
2023-07-06 7:48 ` Jan Beulich
2023-07-05 15:26 ` [XEN PATCH v2 03/13] x86/svm: " Simone Ballarin
2023-07-06 7:52 ` Jan Beulich
2023-07-05 15:26 ` [XEN PATCH v2 04/13] xen/arm: " Simone Ballarin
2023-07-05 16:27 ` Luca Fancellu
2023-07-05 16:42 ` Julien Grall
2023-07-05 15:26 ` [XEN PATCH v2 05/13] xen/device-tree: " Simone Ballarin
2023-07-05 16:28 ` Luca Fancellu
2023-07-05 23:32 ` Stefano Stabellini
2023-07-06 8:01 ` Julien Grall
2023-07-05 15:26 ` [XEN PATCH v2 06/13] xen/efi: " Simone Ballarin
2023-07-05 16:34 ` Luca Fancellu
2023-07-05 23:37 ` Stefano Stabellini
2023-07-06 7:55 ` Jan Beulich
2023-07-06 22:14 ` Stefano Stabellini
2023-07-05 15:26 ` [XEN PATCH v2 07/13] x86/vmx: " Simone Ballarin
2023-07-05 23:39 ` Stefano Stabellini
2023-07-06 8:04 ` Jan Beulich
2023-07-06 22:17 ` Stefano Stabellini
2023-07-07 6:44 ` Jan Beulich
2023-07-07 8:18 ` Simone Ballarin
2023-07-05 15:26 ` [XEN PATCH v2 08/13] xen/pci: " Simone Ballarin
2023-07-06 8:05 ` Jan Beulich
2023-07-05 15:26 ` [XEN PATCH v2 09/13] xen/public: " Simone Ballarin
2023-07-05 15:33 ` Juergen Gross
2023-07-06 7:43 ` Jan Beulich
2023-07-06 7:57 ` Juergen Gross
2023-07-06 8:43 ` Jan Beulich
2023-07-06 9:10 ` Juergen Gross
2023-07-05 23:42 ` Stefano Stabellini
2023-07-05 15:26 ` [XEN PATCH v2 10/13] x86/monitor: " Simone Ballarin
2023-07-05 15:26 ` [XEN PATCH v2 11/13] xen/vpci: " Simone Ballarin
2023-07-06 8:07 ` Jan Beulich
2023-07-05 15:26 ` [XEN PATCH v2 12/13] xen/x86: " Simone Ballarin
2023-07-06 0:11 ` Stefano Stabellini
2023-07-06 8:26 ` Jan Beulich
2023-07-06 16:08 ` Simone Ballarin
2023-07-06 16:22 ` Jan Beulich
2023-07-06 16:22 ` Jan Beulich
2023-07-07 6:50 ` Simone Ballarin
2023-07-07 7:04 ` Jan Beulich
2023-07-07 8:04 ` Simone Ballarin
2023-07-07 9:46 ` Jan Beulich
2023-07-07 21:53 ` Stefano Stabellini
2023-07-10 16:09 ` Simone Ballarin
2023-07-05 15:26 ` [XEN PATCH v2 13/13] xen: " Simone Ballarin
2023-07-05 16:43 ` Luca Fancellu
2023-07-05 18:42 ` Simone Ballarin
2023-07-05 19:32 ` Simone Ballarin
2023-07-06 8:28 ` Jan Beulich
2023-07-05 23:49 ` Stefano Stabellini
2023-07-06 8:34 ` Jan Beulich [this message]
2023-07-06 8:40 ` Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3696380a-b3f9-8fd3-a900-c15c6eea74f6@suse.com \
--to=jbeulich@suse.com \
--cc=Xenia.Ragiadakou@amd.com \
--cc=andrew.cooper3@citrix.com \
--cc=ayan.kumar.halder@amd.com \
--cc=consulting@bugseng.com \
--cc=george.dunlap@citrix.com \
--cc=gianluca.luparini@bugseng.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=simone.ballarin@bugseng.com \
--cc=sstabellini@kernel.org \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.