Skip to contentSkip to conversation

fsldma: fix missing header include

PATCH In review Ira W. Snyder 2 participants 4 messages Sep 2, 2010 – Sep 4, 2010 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fsldma: fix missing header include

The slab.h header is required to use the kmalloc() family of functions. Due to recent kernel changes, this header must be directly included by code that calls into the memory allocator.

---

Without this patch, any code which includes this header fails to build.

 arch/powerpc/include/asm/fsldma.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/powerpc/include/asm/fsldma.h +1 -0
index a67aeed..debc5ed 100644
@@ -11,6 +11,7 @@
 #ifndef __ARCH_POWERPC_ASM_FSLDMA_H__
 #define __ARCH_POWERPC_ASM_FSLDMA_H__
 
+#include <linux/slab.h>
 #include <linux/dmaengine.h>
 
 /*
Signature · 1 line
1.7.1
#1 lore raw
Quoted 17 lines · On Thu, 2 Sep 2010 12:47:52 -0700 "Ira W. Snyder" <[email protected]> wrote:

The slab.h header is required to use the kmalloc() family of functions. Due to recent kernel changes, this header must be directly included by code that calls into the memory allocator.

---

Without this patch, any code which includes this header fails to build.

 arch/powerpc/include/asm/fsldma.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/powerpc/include/asm/fsldma.h +0 -0
index a67aeed..debc5ed 100644

arch/powerpc/include/asm/fsldma.h line 16

Quoted 6 lines
arch/powerpc/include/asm/fsldma.h +1 -0
@@ -11,6 +11,7 @@
 #ifndef __ARCH_POWERPC_ASM_FSLDMA_H__
 #define __ARCH_POWERPC_ASM_FSLDMA_H__
 
+#include <linux/slab.h>
 #include <linux/dmaengine.h>
 

It also needs list.h, but appears to get it via sheer luck.

The functions in that header simply shouldn't have been inlined.

It's peculiar that fsl_dma_slave_append() hardwires GFP_ATOMIC, whereas fsl_dma_slave_alloc() takes a gfp_t.

#2 lore raw
Quoted 29 lines · Andrew Morton
Quoted 17 lines · On Thu, 2 Sep 2010 12:47:52 -0700 "Ira W. Snyder" <[email protected]> wrote:

The slab.h header is required to use the kmalloc() family of functions. Due to recent kernel changes, this header must be directly included by code that calls into the memory allocator.

---

Without this patch, any code which includes this header fails to build.

 arch/powerpc/include/asm/fsldma.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/powerpc/include/asm/fsldma.h +0 -0
index a67aeed..debc5ed 100644

arch/powerpc/include/asm/fsldma.h line 16

Quoted 6 lines
arch/powerpc/include/asm/fsldma.h +1 -0
@@ -11,6 +11,7 @@
 #ifndef __ARCH_POWERPC_ASM_FSLDMA_H__
 #define __ARCH_POWERPC_ASM_FSLDMA_H__
 
+#include <linux/slab.h>
 #include <linux/dmaengine.h>
 

It also needs list.h, but appears to get it via sheer luck.

Quoted 5 lines

The functions in that header simply shouldn't have been inlined.

It's peculiar that fsl_dma_slave_append() hardwires GFP_ATOMIC, whereas fsl_dma_slave_alloc() takes a gfp_t.

Would you like a patch that moves the functions to drivers/dma/fsldma.c and EXPORT_SYMBOL_GPL()'s them? I don't know the consequences to doing so, which is why I avoided it when I wrote arch/powerpc/include/asm/fsldma.h.

Thanks,
Ira

#3 lore raw
Quoted 30 lines · On Fri, 3 Sep 2010 17:47:24 -0700 "Ira W. Snyder" <[email protected]> wrote:
Quoted 29 lines · Andrew Morton
Quoted 17 lines · On Thu, 2 Sep 2010 12:47:52 -0700 "Ira W. Snyder" <[email protected]> wrote:

The slab.h header is required to use the kmalloc() family of functions. Due to recent kernel changes, this header must be directly included by code that calls into the memory allocator.

---

Without this patch, any code which includes this header fails to build.

 arch/powerpc/include/asm/fsldma.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/powerpc/include/asm/fsldma.h +0 -0
index a67aeed..debc5ed 100644

arch/powerpc/include/asm/fsldma.h line 16

Quoted 6 lines
arch/powerpc/include/asm/fsldma.h +1 -0
@@ -11,6 +11,7 @@
 #ifndef __ARCH_POWERPC_ASM_FSLDMA_H__
 #define __ARCH_POWERPC_ASM_FSLDMA_H__
 
+#include <linux/slab.h>
 #include <linux/dmaengine.h>
 

It also needs list.h, but appears to get it via sheer luck.

Quoted 8 lines
Quoted 5 lines

The functions in that header simply shouldn't have been inlined.

It's peculiar that fsl_dma_slave_append() hardwires GFP_ATOMIC, whereas fsl_dma_slave_alloc() takes a gfp_t.

Would you like a patch that moves the functions to drivers/dma/fsldma.c and EXPORT_SYMBOL_GPL()'s them?

Sure, thanks. Then I can harrass Dan with it ;)

Quoted 3 lines

I don't know the consequences to doing
so, which is why I avoided it when I wrote
arch/powerpc/include/asm/fsldma.h.

The minimal fix for the bug was appropriate.