From: Ben Hutchings <bhutchings@solarflare.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Subject: [PATCH] sparse: Fix BUILD_BUG_ON_{ZERO,NULL} definitions
Date: Fri, 24 Jun 2011 22:45:12 +0100 [thread overview]
Message-ID: <1308951912.3034.23.camel@bwh-desktop> (raw)
Commit 903c0c7cdc21f2ccb7562a7bbc70289c0c2b16ad ('sparse: define dummy
BUILD_BUG_ON definition for sparse') left these two broken. The ZERO
or NULL suffix specifies what the macro should expand to, not the
value that would indicate a bug.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
sparse currently reports a syntax error and no useful warnings for any
source file which uses one of these macros. Since module_param() uses
BUILD_BUG_ON_ZERO(), that's a lot of source files.
Ben.
include/linux/kernel.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index fb0e732..fccd366 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -671,8 +671,8 @@ struct sysinfo {
#ifdef __CHECKER__
#define BUILD_BUG_ON_NOT_POWER_OF_2(n)
-#define BUILD_BUG_ON_ZERO(e)
-#define BUILD_BUG_ON_NULL(e)
+#define BUILD_BUG_ON_ZERO(e) ((size_t)0)
+#define BUILD_BUG_ON_NULL(e) ((void *)0)
#define BUILD_BUG_ON(condition)
#else /* __CHECKER__ */
--
1.7.4.4
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
next reply other threads:[~2011-06-24 21:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-24 21:45 Ben Hutchings [this message]
2011-06-24 22:28 ` Randy Dunlap
2011-06-24 22:48 ` Ben Hutchings
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=1308951912.3034.23.camel@bwh-desktop \
--to=bhutchings@solarflare.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.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
all inboxes | Powered by JetHome®