mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: Randy Dunlap <rdunlap@xenotime.net>
Cc: LKML <linux-kernel@vger.kernel.org>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Subject: Re: [PATCH] sparse: Fix BUILD_BUG_ON_{ZERO,NULL} definitions
Date: Fri, 24 Jun 2011 23:48:44 +0100	[thread overview]
Message-ID: <1308955724.3034.28.camel@bwh-desktop> (raw)
In-Reply-To: <20110624152853.6fd65f41.rdunlap@xenotime.net>

On Fri, 2011-06-24 at 15:28 -0700, Randy Dunlap wrote:
> On Fri, 24 Jun 2011 22:45:12 +0100 Ben Hutchings wrote:
> 
> > 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.
> 
> This patch from 2011-MAY-30 also fixes these warnings, but the typecasting
> in yours is probably better.  :)
>
> http://marc.info/?l=linux-kernel&m=130677145629121&w=2
> 
> Wait, 3.0-rc4 already has the above patch.  Is yours still needed?
[...]

Sorry, my baseline was a little out of date.

I'm not sure whether the type of BUILD_BUG_ON_ZERO() should be size_t;
that's just what the non-sparse definition works out as.  In some cases
it could make a difference whether it's signed or not.

Ben.

-- 
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.


      reply	other threads:[~2011-06-24 22:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-24 21:45 Ben Hutchings
2011-06-24 22:28 ` Randy Dunlap
2011-06-24 22:48   ` Ben Hutchings [this message]

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=1308955724.3034.28.camel@bwh-desktop \
    --to=bhutchings@solarflare.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@xenotime.net \
    /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®