[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1302817191.16562.1036.camel@nimitz>
Date: Thu, 14 Apr 2011 14:39:51 -0700
From: Dave Hansen <dave@...1.net>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Rusty Russell <rusty@...tcorp.com.au>,
Jan Beulich <JBeulich@...ell.com>,
Christoph Lameter <cl@...ux.com>,
linux-mm <linux-mm@...ck.org>,
lkml <linux-kernel@...r.kernel.org>
Subject: Re: BUILD_BUG_ON() breaks sparse gfp_t checks
On Thu, 2011-04-14 at 13:22 -0700, Andrew Morton wrote:
> The kernel calls gfp_zone() with a constant arg in very few places.
> This?
>
> --- a/include/linux/gfp.h~a
> +++ a/include/linux/gfp.h
> @@ -249,14 +249,9 @@ static inline enum zone_type gfp_zone(gf
>
> z = (GFP_ZONE_TABLE >> (bit * ZONES_SHIFT)) &
> ((1 << ZONES_SHIFT) - 1);
> -
> - if (__builtin_constant_p(bit))
> - BUILD_BUG_ON((GFP_ZONE_BAD >> bit) & 1);
> - else {
> #ifdef CONFIG_DEBUG_VM
> - BUG_ON((GFP_ZONE_BAD >> bit) & 1);
> + BUG_ON((GFP_ZONE_BAD >> bit) & 1);
> #endif
> - }
> return z;
> }
That definitely makes sparse happier. I hope the folks on cc will chime
in if they wanted something special at build time.
-- Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists