diff mbox series

[XEN] x86/cpufreq: address MISRA Rule 7.3 violation

Message ID c5aa988e00f94cf793b7ecae49a4eb94db785dee.1725958056.git.nicola.vetrini@bugseng.com (mailing list archive)
State New
Headers show
Series [XEN] x86/cpufreq: address MISRA Rule 7.3 violation | expand

Commit Message

Nicola Vetrini Sept. 10, 2024, 8:48 a.m. UTC
Rule 7.3 states:
"The lowercase character l shall not be used in a literal suffix",
but the INTEL_MSR_RANGE macro uses the "ull" suffix.
The "u" is transformed in uppercase for consistency.

No functional change.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/arch/x86/acpi/cpufreq/acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jan Beulich Sept. 10, 2024, 9:12 a.m. UTC | #1
On 10.09.2024 10:48, Nicola Vetrini wrote:
> Rule 7.3 states:
> "The lowercase character l shall not be used in a literal suffix",
> but the INTEL_MSR_RANGE macro uses the "ull" suffix.
> The "u" is transformed in uppercase for consistency.
> 
> No functional change.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>

Acked-by: Jan Beulich <jbeulich@suse.com>

I'm heavily tempted though to ...

> --- a/xen/arch/x86/acpi/cpufreq/acpi.c
> +++ b/xen/arch/x86/acpi/cpufreq/acpi.c
> @@ -25,7 +25,7 @@ enum {
>      SYSTEM_IO_CAPABLE,
>  };
>  
> -#define INTEL_MSR_RANGE         (0xffffull)
> +#define INTEL_MSR_RANGE         (0xffffULL)

... drop the pointless parentheses while committing.

Jan
Andrew Cooper Sept. 10, 2024, 10:55 a.m. UTC | #2
On 10/09/2024 10:12 am, Jan Beulich wrote:
> On 10.09.2024 10:48, Nicola Vetrini wrote:
>> Rule 7.3 states:
>> "The lowercase character l shall not be used in a literal suffix",
>> but the INTEL_MSR_RANGE macro uses the "ull" suffix.
>> The "u" is transformed in uppercase for consistency.
>>
>> No functional change.
>>
>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> Acked-by: Jan Beulich <jbeulich@suse.com>
>
> I'm heavily tempted though to ...
>
>> --- a/xen/arch/x86/acpi/cpufreq/acpi.c
>> +++ b/xen/arch/x86/acpi/cpufreq/acpi.c
>> @@ -25,7 +25,7 @@ enum {
>>      SYSTEM_IO_CAPABLE,
>>  };
>>  
>> -#define INTEL_MSR_RANGE         (0xffffull)
>> +#define INTEL_MSR_RANGE         (0xffffULL)
> ... drop the pointless parentheses while committing.

I'd be tempted to delete the constant entirely.

It's utterly wrong and unsafe everywhere it's used...

~Andrew
diff mbox series

Patch

diff --git a/xen/arch/x86/acpi/cpufreq/acpi.c b/xen/arch/x86/acpi/cpufreq/acpi.c
index c6d7d02faa56..06f6c99d4cc1 100644
--- a/xen/arch/x86/acpi/cpufreq/acpi.c
+++ b/xen/arch/x86/acpi/cpufreq/acpi.c
@@ -25,7 +25,7 @@  enum {
     SYSTEM_IO_CAPABLE,
 };
 
-#define INTEL_MSR_RANGE         (0xffffull)
+#define INTEL_MSR_RANGE         (0xffffULL)
 
 static bool __read_mostly acpi_pstate_strict;
 boolean_param("acpi_pstate_strict", acpi_pstate_strict);