lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 28 Sep 2010 22:41:42 +0100
From:	Al Viro <viro@...IV.linux.org.uk>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Namhyung Kim <namhyung@...il.com>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: cleanup gfp_zone()

On Tue, Sep 28, 2010 at 02:32:39PM -0700, Andrew Morton wrote:
> > +#define ZT_SHIFT(gfp) ((__force int) (gfp) * ZONES_SHIFT)
> >  #define GFP_ZONE_TABLE ( \
> > -	(ZONE_NORMAL << 0 * ZONES_SHIFT)				\
> > -	| (OPT_ZONE_DMA << __GFP_DMA * ZONES_SHIFT)			\
> > -	| (OPT_ZONE_HIGHMEM << __GFP_HIGHMEM * ZONES_SHIFT)		\
> > -	| (OPT_ZONE_DMA32 << __GFP_DMA32 * ZONES_SHIFT)			\
> > -	| (ZONE_NORMAL << __GFP_MOVABLE * ZONES_SHIFT)			\
> > -	| (OPT_ZONE_DMA << (__GFP_MOVABLE | __GFP_DMA) * ZONES_SHIFT)	\
> > -	| (ZONE_MOVABLE << (__GFP_MOVABLE | __GFP_HIGHMEM) * ZONES_SHIFT)\
> > -	| (OPT_ZONE_DMA32 << (__GFP_MOVABLE | __GFP_DMA32) * ZONES_SHIFT)\
> > +	(ZONE_NORMAL        << ZT_SHIFT(0))				\
> > +	| (OPT_ZONE_DMA     << ZT_SHIFT(__GFP_DMA))			\
> > +	| (OPT_ZONE_HIGHMEM << ZT_SHIFT(__GFP_HIGHMEM))			\
> > +	| (OPT_ZONE_DMA32   << ZT_SHIFT(__GFP_DMA32))			\
> > +	| (ZONE_NORMAL      << ZT_SHIFT(__GFP_MOVABLE))			\
> > +	| (OPT_ZONE_DMA     << ZT_SHIFT(__GFP_MOVABLE | __GFP_DMA))	\
> > +	| (ZONE_MOVABLE     << ZT_SHIFT(__GFP_MOVABLE | __GFP_HIGHMEM)) \
> > +	| (OPT_ZONE_DMA32   << ZT_SHIFT(__GFP_MOVABLE | __GFP_DMA32))	\
> >  )
> 
> hm.  I hope these sparse warnings are sufficiently useful to justify
> all the gunk we're adding to support them.
> 
> Is it actually finding any bugs?

FWIW, bitwise or done in the right-hand argumet of shift looks ugly as hell;
what the hell is that code _doing_?
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ