Messages in this thread | | | Subject | Re: [PATCH 2/2] x86: Fix typo in MSR_IA32_MISC_ENABLE_LIMIT_CPUID macro | From | Joe Perches <> | Date | Fri, 09 May 2014 10:02:58 -0700 |
| |
On Fri, 2014-05-09 at 12:33 +0200, Borislav Petkov wrote: > On Fri, May 09, 2014 at 09:57:30AM +0200, Borislav Petkov wrote: > > > diff --git a/arch/x86/include/uapi/asm/msr-index.h b/arch/x86/include/uapi/asm/msr-index.h [] > > > -#define MSR_IA32_MISC_ENABLE_LIMIT_CPUID (1ULL << MSR_IA32_MISC_ENABLE_LIMIT_CPUID_BIT); > > > +#define MSR_IA32_MISC_ENABLE_LIMIT_CPUID (1ULL << MSR_IA32_MISC_ENABLE_LIMIT_CPUID_BIT) > > Btw, we should probably be catching typos like that with checkpatch. > Here's an initial version for single-line macros: [] > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > @@ -3313,6 +3313,11 @@ sub process { > } > } > > + if ($line =~ /^\+\s*#\s*define\s.*;\s*$/) { > + WARN("TRAILING_SEMICOLON", > + "Trailing semicolon at macro definition\n" . $herecurr); > + } > +
Seems sensible.
I suggest moving the test next to the other macro definition tests for things like unnecessary semicolon around "do {... while (0)" around line 3800.
Extending the test to find multiline forms like
#define foo \ bar;
would also be trivially done there.
| |