* [PATCH linux-next-20110718] Fix build error at mm/slab.c .
@ 2011-07-20 3:19 Tetsuo Handa
2011-07-20 13:16 ` Pekka Enberg
0 siblings, 1 reply; 5+ messages in thread
From: Tetsuo Handa @ 2011-07-20 3:19 UTC (permalink / raw)
To: cl, penberg; +Cc: linux-kernel
ARCH_SLAB_MINALIGN might be defined as
#define ARCH_SLAB_MINALIGN __alignof__(unsigned long long)
but gcc 3.3 cannot understand
#if __alignof__(unsigned long long)
line.
CC mm/slab.o
mm/slab.c:3156:5: warning: "__alignof__" is not defined
mm/slab.c:3156:5: missing binary operator before token "("
make[1]: *** [mm/slab.o] Error 1
make: *** [mm] Error 2
Use "if (ARCH_SLAB_MINALIGN)" rather than "#if ARCH_SLAB_MINALIGN".
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
---
mm/slab.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
--- linux-3.0-next.orig/mm/slab.c
+++ linux-3.0-next/mm/slab.c
@@ -3153,12 +3153,9 @@ static void *cache_alloc_debugcheck_afte
objp += obj_offset(cachep);
if (cachep->ctor && cachep->flags & SLAB_POISON)
cachep->ctor(objp);
-#if ARCH_SLAB_MINALIGN
- if ((u32)objp & (ARCH_SLAB_MINALIGN-1)) {
+ if (ARCH_SLAB_MINALIGN && ((u32)objp & (ARCH_SLAB_MINALIGN-1)))
printk(KERN_ERR "0x%p: not aligned to ARCH_SLAB_MINALIGN=%d\n",
objp, ARCH_SLAB_MINALIGN);
- }
-#endif
return objp;
}
#else
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH linux-next-20110718] Fix build error at mm/slab.c .
2011-07-20 3:19 [PATCH linux-next-20110718] Fix build error at mm/slab.c Tetsuo Handa
@ 2011-07-20 13:16 ` Pekka Enberg
2011-07-20 13:58 ` Christoph Lameter
0 siblings, 1 reply; 5+ messages in thread
From: Pekka Enberg @ 2011-07-20 13:16 UTC (permalink / raw)
To: Tetsuo Handa; +Cc: cl, linux-kernel
On Wed, 20 Jul 2011, Tetsuo Handa wrote:
> ARCH_SLAB_MINALIGN might be defined as
>
> #define ARCH_SLAB_MINALIGN __alignof__(unsigned long long)
>
> but gcc 3.3 cannot understand
>
> #if __alignof__(unsigned long long)
>
> line.
>
> CC mm/slab.o
> mm/slab.c:3156:5: warning: "__alignof__" is not defined
> mm/slab.c:3156:5: missing binary operator before token "("
> make[1]: *** [mm/slab.o] Error 1
> make: *** [mm] Error 2
>
> Use "if (ARCH_SLAB_MINALIGN)" rather than "#if ARCH_SLAB_MINALIGN".
>
> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> ---
> mm/slab.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> --- linux-3.0-next.orig/mm/slab.c
> +++ linux-3.0-next/mm/slab.c
> @@ -3153,12 +3153,9 @@ static void *cache_alloc_debugcheck_afte
> objp += obj_offset(cachep);
> if (cachep->ctor && cachep->flags & SLAB_POISON)
> cachep->ctor(objp);
> -#if ARCH_SLAB_MINALIGN
> - if ((u32)objp & (ARCH_SLAB_MINALIGN-1)) {
> + if (ARCH_SLAB_MINALIGN && ((u32)objp & (ARCH_SLAB_MINALIGN-1)))
> printk(KERN_ERR "0x%p: not aligned to ARCH_SLAB_MINALIGN=%d\n",
> objp, ARCH_SLAB_MINALIGN);
> - }
> -#endif
> return objp;
Looks good to me. Christoph?
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH linux-next-20110718] Fix build error at mm/slab.c .
2011-07-20 13:16 ` Pekka Enberg
@ 2011-07-20 13:58 ` Christoph Lameter
2011-07-20 17:37 ` Pekka Enberg
0 siblings, 1 reply; 5+ messages in thread
From: Christoph Lameter @ 2011-07-20 13:58 UTC (permalink / raw)
To: Pekka Enberg; +Cc: Tetsuo Handa, linux-kernel
On Wed, 20 Jul 2011, Pekka Enberg wrote:
> > +++ linux-3.0-next/mm/slab.c
> > @@ -3153,12 +3153,9 @@ static void *cache_alloc_debugcheck_afte
> > objp += obj_offset(cachep);
> > if (cachep->ctor && cachep->flags & SLAB_POISON)
> > cachep->ctor(objp);
> > -#if ARCH_SLAB_MINALIGN
> > - if ((u32)objp & (ARCH_SLAB_MINALIGN-1)) {
> > + if (ARCH_SLAB_MINALIGN && ((u32)objp & (ARCH_SLAB_MINALIGN-1)))
> > printk(KERN_ERR "0x%p: not aligned to
> > ARCH_SLAB_MINALIGN=%d\n",
> > objp, ARCH_SLAB_MINALIGN);
> > - }
> > -#endif
> > return objp;
>
> Looks good to me. Christoph?
Looks okay but I thought you already had a patch that took out the #if
there?
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH linux-next-20110718] Fix build error at mm/slab.c .
2011-07-20 13:58 ` Christoph Lameter
@ 2011-07-20 17:37 ` Pekka Enberg
2011-07-21 0:42 ` Tetsuo Handa
0 siblings, 1 reply; 5+ messages in thread
From: Pekka Enberg @ 2011-07-20 17:37 UTC (permalink / raw)
To: Christoph Lameter; +Cc: Tetsuo Handa, linux-kernel
On Wed, 20 Jul 2011, Christoph Lameter wrote:
> On Wed, 20 Jul 2011, Pekka Enberg wrote:
>
>>> +++ linux-3.0-next/mm/slab.c
>>> @@ -3153,12 +3153,9 @@ static void *cache_alloc_debugcheck_afte
>>> objp += obj_offset(cachep);
>>> if (cachep->ctor && cachep->flags & SLAB_POISON)
>>> cachep->ctor(objp);
>>> -#if ARCH_SLAB_MINALIGN
>>> - if ((u32)objp & (ARCH_SLAB_MINALIGN-1)) {
>>> + if (ARCH_SLAB_MINALIGN && ((u32)objp & (ARCH_SLAB_MINALIGN-1)))
>>> printk(KERN_ERR "0x%p: not aligned to
>>> ARCH_SLAB_MINALIGN=%d\n",
>>> objp, ARCH_SLAB_MINALIGN);
>>> - }
>>> -#endif
>>> return objp;
>>
>> Looks good to me. Christoph?
>
> Looks okay but I thought you already had a patch that took out the #if
> there?
Indeed. Tetsuo, it's commit c225150 ("slab: fix DEBUG_SLAB build") in
slab.git. It should appear in linux-next soon.
Pekka
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH linux-next-20110718] Fix build error at mm/slab.c .
2011-07-20 17:37 ` Pekka Enberg
@ 2011-07-21 0:42 ` Tetsuo Handa
0 siblings, 0 replies; 5+ messages in thread
From: Tetsuo Handa @ 2011-07-21 0:42 UTC (permalink / raw)
To: penberg; +Cc: linux-kernel, cl
Pekka Enberg wrote:
> On Wed, 20 Jul 2011, Christoph Lameter wrote:
> > Looks okay but I thought you already had a patch that took out the #if
> > there?
>
> Indeed. Tetsuo, it's commit c225150 ("slab: fix DEBUG_SLAB build") in
> slab.git. It should appear in linux-next soon.
Ah, that commit is in linux-next-20110720, but I think it wants below one.
----------------------------------------
[PATCH] slab: fix DEBUG_SLAB warning.
In commit c225150b "slab: fix DEBUG_SLAB build",
"if ((unsigned long)objp & (ARCH_SLAB_MINALIGN-1))" is always true if
ARCH_SLAB_MINALIGN == 0. Do not print warning if ARCH_SLAB_MINALIGN == 0.
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
---
mm/slab.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- linux-next.orig/mm/slab.c
+++ linux-next/mm/slab.c
@@ -3153,7 +3153,8 @@ static void *cache_alloc_debugcheck_afte
objp += obj_offset(cachep);
if (cachep->ctor && cachep->flags & SLAB_POISON)
cachep->ctor(objp);
- if ((unsigned long)objp & (ARCH_SLAB_MINALIGN-1)) {
+ if (ARCH_SLAB_MINALIGN &&
+ ((unsigned long)objp & (ARCH_SLAB_MINALIGN-1))) {
printk(KERN_ERR "0x%p: not aligned to ARCH_SLAB_MINALIGN=%d\n",
objp, (int)ARCH_SLAB_MINALIGN);
}
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-07-21 0:42 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-20 3:19 [PATCH linux-next-20110718] Fix build error at mm/slab.c Tetsuo Handa
2011-07-20 13:16 ` Pekka Enberg
2011-07-20 13:58 ` Christoph Lameter
2011-07-20 17:37 ` Pekka Enberg
2011-07-21 0:42 ` Tetsuo Handa
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®