lkml.org 
[lkml]   [2011]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH next/mmotm] slab: fix DEBUG_SLAB build
On Wed, 13 Jul 2011, Christoph Lameter wrote:
> On Tue, 12 Jul 2011, Hugh Dickins wrote:
> > On Tue, 12 Jul 2011, Christoph Lameter wrote:
> > > On Mon, 11 Jul 2011, Hugh Dickins wrote:
> > >
> > > > -#if ARCH_SLAB_MINALIGN
> > > > - if ((u32)objp & (ARCH_SLAB_MINALIGN-1)) {
> > > > + if ((unsigned long)objp & (ARCH_SLAB_MINALIGN-1)) {
> > > > printk(KERN_ERR "0x%p: not aligned to ARCH_SLAB_MINALIGN=%d\n",
> > >
> > > Change %d to %ul for consistencies sake and drop the cast of
> > > ARCH_SLAB_MINALIGN?
> >
> > I don't think we can drop the cast of ARCH_SLAB_MINALIGN, or not without
> > a wander through all the architectures: it could well be defined as a bare
> > integer in some of them, even if the default definition as __alignof__
> > comes out as an unsigned long (which itself surprised me).
>
> A bare integer can be handled by a %lu in a printk without the need for a
> cast.

Really? Here if I try that on x86_64 with #define ARCH_SLAB_MINALIGN 8, I get
mm/slab.c: In function `cache_alloc_debugcheck_after':
mm/slab.c:3160:10: warning: format `%lu' expects type `long unsigned int', but argument 3 has type `int'

Hugh


\
 
 \ /
  Last update: 2011-07-13 18:01    [W:0.164 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site