From: Jan Beulich <jbeulich@suse.com>
To: Simone Ballarin <simone.ballarin@bugseng.com>
Cc: consulting@bugseng.com,
"Gianluca Luparini" <gianluca.luparini@bugseng.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>,
"Paul Durrant" <paul@xen.org>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Michal Orzel" <michal.orzel@amd.com>,
"Xenia Ragiadakou" <Xenia.Ragiadakou@amd.com>,
"Ayan Kumar Halder" <ayan.kumar.halder@amd.com>,
xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH v2 12/13] xen/x86: fix violations of MISRA C:2012 Rule 7.2
Date: Fri, 7 Jul 2023 09:04:04 +0200 [thread overview]
Message-ID: <fb29cca6-454c-82ed-b6a8-ac9814f81cfa@suse.com> (raw)
In-Reply-To: <CAFHJcJuP7hH01ZiwNe0HHBM=JpBtsF9sDD7fushyBxDQ9UZicw@mail.gmail.com>
On 07.07.2023 08:50, Simone Ballarin wrote:
> Il giorno gio 6 lug 2023 alle ore 18:22 Jan Beulich <jbeulich@suse.com> ha
> scritto:
>
>> On 06.07.2023 18:08, Simone Ballarin wrote:
>>> Il giorno gio 6 lug 2023 alle ore 10:26 Jan Beulich <jbeulich@suse.com>
>> ha
>>> scritto:
>>>
>>>> On 05.07.2023 17:26, Simone Ballarin wrote:
>>>>> --- a/xen/arch/x86/apic.c
>>>>> +++ b/xen/arch/x86/apic.c
>>>>> @@ -1211,7 +1211,7 @@ static void __init calibrate_APIC_clock(void)
>>>>> * Setup the APIC counter to maximum. There is no way the lapic
>>>>> * can underflow in the 100ms detection time frame.
>>>>> */
>>>>> - __setup_APIC_LVTT(0xffffffff);
>>>>> + __setup_APIC_LVTT(0xffffffffU);
>>>>
>>>> While making the change less mechanical, we want to consider to switch
>>>> to ~0 in this and similar cases.
>>>>
>>>
>>> Changing ~0U is more than not mechanical: it is possibly dangerous.
>>> The resulting value could be different depending on the architecture,
>>> I prefer to not make such kind of changes in a MISRA-related patch.
>>
>> What do you mean by "depending on the architecture", when this is
>> x86-only code _and_ you can check what type parameter the called
>> function has?
>
> Ok, I will change these literals in ~0U in the next submission.
Except that I specifically meant ~0, not ~0U. We mean "maximum value"
here, and at the call site it doesn't matter how wide the function
parameter's type is. If it was 64-bit, ~0U would not do what is wanted.
Jan
next prev parent reply other threads:[~2023-07-07 7:04 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-07 6:50 ` Simone Ballarin
2023-07-07 7:04 ` Jan Beulich [this message]
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-06 16:22 ` Jan Beulich
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
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=fb29cca6-454c-82ed-b6a8-ac9814f81cfa@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=gianluca.luparini@bugseng.com \
--cc=michal.orzel@amd.com \
--cc=paul@xen.org \
--cc=roger.pau@citrix.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.