All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] slab.c ifdef reduction breaks build
@ 2007-01-29 20:05 Jeff Dike
  2007-01-29 20:15 ` Christoph Lameter
  0 siblings, 1 reply; 6+ messages in thread
From: Jeff Dike @ 2007-01-29 20:05 UTC (permalink / raw)
  To: akpm, Christoph Lameter; +Cc: linux-kernel

optional-zone_dma-in-the-vm-no-gfp_dma-check-in-the-slab-if-
no-config_zone_dma-is-set-reduce-config_zone_dma-ifdefs converts some
ifdefs into ifs.

One of them causes cs_dmacachep to be referenced, when that field
doesn't exist, because it's ifdefed on CONFIG_ZONE_DMA.

I'd suggest reverting that chunk.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
--
 mm/slab.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Index: linux-2.6.18-mm/mm/slab.c
===================================================================
--- linux-2.6.18-mm.orig/mm/slab.c	2007-01-29 14:32:13.000000000 -0500
+++ linux-2.6.18-mm/mm/slab.c	2007-01-29 15:04:18.000000000 -0500
@@ -1492,14 +1492,15 @@ void __init kmem_cache_init(void)
 					ARCH_KMALLOC_FLAGS|SLAB_PANIC,
 					NULL, NULL);
 		}
-		if (CONFIG_ZONE_DMA_FLAG)
-			sizes->cs_dmacachep = kmem_cache_create(
+#if CONFIG_ZONE_DMA_FLAG
+		sizes->cs_dmacachep = kmem_cache_create(
 					names->name_dma,
 					sizes->cs_size,
 					ARCH_KMALLOC_MINALIGN,
 					ARCH_KMALLOC_FLAGS|SLAB_CACHE_DMA|
 						SLAB_PANIC,
 					NULL, NULL);
+#endif
 		sizes++;
 		names++;
 	}

-- 
Work email - jdike at linux dot intel dot com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] slab.c ifdef reduction breaks build
  2007-01-29 20:05 [PATCH] slab.c ifdef reduction breaks build Jeff Dike
@ 2007-01-29 20:15 ` Christoph Lameter
  2007-01-29 20:41   ` Christoph Lameter
  0 siblings, 1 reply; 6+ messages in thread
From: Christoph Lameter @ 2007-01-29 20:15 UTC (permalink / raw)
  To: Jeff Dike; +Cc: akpm, linux-kernel

On Mon, 29 Jan 2007, Jeff Dike wrote:

> +#if CONFIG_ZONE_DMA_FLAG
> +		sizes->cs_dmacachep = kmem_cache_create(

This would need to be

#idef CONFIG_ZONE_DMA

There have been some recent changes though so I am not sure what your 
codebase is.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] slab.c ifdef reduction breaks build
  2007-01-29 20:15 ` Christoph Lameter
@ 2007-01-29 20:41   ` Christoph Lameter
  2007-01-29 20:56     ` Andrew Morton
  0 siblings, 1 reply; 6+ messages in thread
From: Christoph Lameter @ 2007-01-29 20:41 UTC (permalink / raw)
  To: Jeff Dike; +Cc: akpm, linux-kernel

I also hit the same issue. Here is the patch:


Fix slab build failure if !CONFIG_ZONE_DMA

I also needed this to get 2.6.20-rc6-mm2 to build. Fixes the fix by the
complainer about the fixes. #ifdef cannot be avoided since cs_dmacachep
is no longer defined.

Signed-off-by: Christoph Lameter <clameter@sgi.com>

Index: linux-2.6.20-rc6-mm2/mm/slab.c
===================================================================
--- linux-2.6.20-rc6-mm2.orig/mm/slab.c	2007-01-29 14:27:58.000000000 -0600
+++ linux-2.6.20-rc6-mm2/mm/slab.c	2007-01-29 14:33:04.270329009 -0600
@@ -1503,6 +1503,7 @@ void __init kmem_cache_init(void)
 					ARCH_KMALLOC_FLAGS|SLAB_PANIC,
 					NULL, NULL);
 		}
+#ifdef CONFIG_ZONE_DMA
 		if (CONFIG_ZONE_DMA_FLAG)
 			sizes->cs_dmacachep = kmem_cache_create(
 					names->name_dma,
@@ -1511,6 +1512,7 @@ void __init kmem_cache_init(void)
 					ARCH_KMALLOC_FLAGS|SLAB_CACHE_DMA|
 						SLAB_PANIC,
 					NULL, NULL);
+#endif
 		sizes++;
 		names++;
 	}

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] slab.c ifdef reduction breaks build
  2007-01-29 20:41   ` Christoph Lameter
@ 2007-01-29 20:56     ` Andrew Morton
  2007-01-29 21:44       ` Christoph Lameter
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Morton @ 2007-01-29 20:56 UTC (permalink / raw)
  To: Christoph Lameter; +Cc: Jeff Dike, linux-kernel

On Mon, 29 Jan 2007 12:41:33 -0800 (PST)
Christoph Lameter <clameter@sgi.com> wrote:

> +#ifdef CONFIG_ZONE_DMA
>  		if (CONFIG_ZONE_DMA_FLAG)

We don't need the `if (CONFIG_ZONE_DMA_FLAG)' any more, do we?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] slab.c ifdef reduction breaks build
  2007-01-29 20:56     ` Andrew Morton
@ 2007-01-29 21:44       ` Christoph Lameter
  2007-01-30 19:59         ` Christoph Lameter
  0 siblings, 1 reply; 6+ messages in thread
From: Christoph Lameter @ 2007-01-29 21:44 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Jeff Dike, linux-kernel

On Mon, 29 Jan 2007, Andrew Morton wrote:

> On Mon, 29 Jan 2007 12:41:33 -0800 (PST)
> Christoph Lameter <clameter@sgi.com> wrote:
> 
> > +#ifdef CONFIG_ZONE_DMA
> >  		if (CONFIG_ZONE_DMA_FLAG)
> 
> We don't need the `if (CONFIG_ZONE_DMA_FLAG)' any more, do we?

Correct.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] slab.c ifdef reduction breaks build
  2007-01-29 21:44       ` Christoph Lameter
@ 2007-01-30 19:59         ` Christoph Lameter
  0 siblings, 0 replies; 6+ messages in thread
From: Christoph Lameter @ 2007-01-30 19:59 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Jeff Dike, linux-kernel

On Mon, 29 Jan 2007, Christoph Lameter wrote:

> On Mon, 29 Jan 2007, Andrew Morton wrote:
> 
> > On Mon, 29 Jan 2007 12:41:33 -0800 (PST)
> > Christoph Lameter <clameter@sgi.com> wrote:
> > 
> > > +#ifdef CONFIG_ZONE_DMA
> > >  		if (CONFIG_ZONE_DMA_FLAG)
> > 
> > We don't need the `if (CONFIG_ZONE_DMA_FLAG)' any more, do we?
> 
> Correct.
> 

Here is the modified patch:


Fix slab build failure if !CONFIG_ZONE_DMA

I also needed this to get 2.6.20-rc6-mm2 to build. Fixes the fix of the
complainer about the fixes.

Signed-off-by: Christoph Lameter <clameter@sgi.com>

Index: linux-2.6.20-rc6-mm2/mm/slab.c
===================================================================
--- linux-2.6.20-rc6-mm2.orig/mm/slab.c	2007-01-30 13:56:10.683074081 -0600
+++ linux-2.6.20-rc6-mm2/mm/slab.c	2007-01-30 13:57:13.152420752 -0600
@@ -1504,14 +1504,15 @@ void __init kmem_cache_init(void)
 					ARCH_KMALLOC_FLAGS|SLAB_PANIC,
 					NULL, NULL);
 		}
-		if (CONFIG_ZONE_DMA_FLAG)
-			sizes->cs_dmacachep = kmem_cache_create(
+#ifdef CONFIG_ZONE_DMA
+		sizes->cs_dmacachep = kmem_cache_create(
 					names->name_dma,
 					sizes->cs_size,
 					ARCH_KMALLOC_MINALIGN,
 					ARCH_KMALLOC_FLAGS|SLAB_CACHE_DMA|
 						SLAB_PANIC,
 					NULL, NULL);
+#endif
 		sizes++;
 		names++;
 	}

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-01-30 19:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-29 20:05 [PATCH] slab.c ifdef reduction breaks build Jeff Dike
2007-01-29 20:15 ` Christoph Lameter
2007-01-29 20:41   ` Christoph Lameter
2007-01-29 20:56     ` Andrew Morton
2007-01-29 21:44       ` Christoph Lameter
2007-01-30 19:59         ` Christoph Lameter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.