From: Borislav Petkov <bp@suse.de>
To: Andres Freund <andres@anarazel.de>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
"H. Peter Anvin" <hpa@linux.intel.com>,
Ingo Molnar <mingo@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>
Subject: Re: [PATCH 2/2] x86: Fix typo in MSR_IA32_MISC_ENABLE_LIMIT_CPUID macro
Date: Fri, 9 May 2014 12:33:03 +0200 [thread overview]
Message-ID: <20140509103303.GC16058@pd.tnic> (raw)
In-Reply-To: <20140509075730.GB16058@pd.tnic>
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
> > index c827ace..fcf2b3a 100644
> > --- a/arch/x86/include/uapi/asm/msr-index.h
> > +++ b/arch/x86/include/uapi/asm/msr-index.h
> > @@ -384,7 +384,7 @@
> > #define MSR_IA32_MISC_ENABLE_MWAIT_BIT 18
> > #define MSR_IA32_MISC_ENABLE_MWAIT (1ULL << MSR_IA32_MISC_ENABLE_MWAIT_BIT)
> > #define MSR_IA32_MISC_ENABLE_LIMIT_CPUID_BIT 22
> > -#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:
---
From: Borislav Petkov <bp@suse.de>
Subject: [PATCH] checkpatch: Catch trailing semicolons in macro definitions
This currently checks only single-line macro definitions. I.e.,
$ git show c0a639ad0bc6b178b46996bd1f821a04643e2bde | ./scripts/checkpatch.pl -
...
WARNING: Trailing semicolon at macro definition
+#define MSR_IA32_MISC_ENABLE_LIMIT_CPUID (1ULL << MSR_BIT_LIMIT_CPUID);
Signed-off-by: Borislav Petkov <bp@suse.de>
---
scripts/checkpatch.pl | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 34eb2160489d..04929c20c9b5 100755
--- 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);
+ }
+
# check for multiple assignments
if ($line =~ /^.\s*$Lval\s*=\s*$Lval\s*=(?!=)/) {
CHK("MULTIPLE_ASSIGNMENTS",
--
1.9.0
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
next prev parent reply other threads:[~2014-05-09 10:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-09 1:29 Andres Freund
2014-05-09 1:29 ` [PATCH 1/2] x86: Fix typo preventing msr_set/clear_bit from having an effect Andres Freund
2014-05-09 7:54 ` Borislav Petkov
2014-05-09 10:39 ` Andres Freund
2014-05-09 10:46 ` Borislav Petkov
2014-05-09 16:31 ` [tip:x86/urgent] x86: Fix typo preventing msr_set/ clear_bit " tip-bot for Andres Freund
2014-05-09 1:29 ` [PATCH 2/2] x86: Fix typo in MSR_IA32_MISC_ENABLE_LIMIT_CPUID macro Andres Freund
2014-05-09 7:57 ` Borislav Petkov
2014-05-09 10:33 ` Borislav Petkov [this message]
2014-05-09 17:02 ` Joe Perches
2014-05-09 21:31 ` [PATCH] checkpatch: Warn on #defines ending in semicolon Joe Perches
2014-05-09 21:47 ` Thomas Gleixner
2014-05-09 21:59 ` Joe Perches
2014-05-09 16:31 ` [tip:x86/urgent] x86: Fix typo in MSR_IA32_MISC_ENABLE_LIMIT_CPUID macro tip-bot for Andres Freund
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=20140509103303.GC16058@pd.tnic \
--to=bp@suse.de \
--cc=andres@anarazel.de \
--cc=apw@canonical.com \
--cc=hpa@linux.intel.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox