Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MN10300: Don't try and #include <linux/slab.h> in lib/inflate.c from bootloader

Don't try and #include <linux/slab.h> in lib/inflate.c from the bootloader code
as linux/slab.h hauls in function defs that aren't available in the bootloader
code and may also haul in conflicting functions.

To fix this, make the inclusion of linux/slab.h contingent on NO_INFLATE_MALLOC
as are the usages of kmalloc() and kfree().

In MN10300, this causes the following errors:

In file included from include/linux/string.h:21,
from include/linux/bitmap.h:8,
from include/linux/nodemask.h:93,
from include/linux/mmzone.h:16,
from include/linux/gfp.h:4,
from include/linux/slab.h:12,
from arch/mn10300/boot/compressed/../../../../lib/inflate.c:106,
from arch/mn10300/boot/compressed/misc.c:170:
/warthog/am33/linux-2.6-mn10300/arch/mn10300/include/asm/string.h:19: error: conflicting types for 'memset'
arch/mn10300/boot/compressed/misc.c:59: error: previous definition of 'memset' was here

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

David Howells and committed by
Linus Torvalds
1490cf5f 019fca84

+3
+1
arch/mn10300/boot/compressed/misc.c
··· 167 167 static char *vidmem = (char *)0xb8000; 168 168 static int lines, cols; 169 169 170 + #define BOOTLOADER_INFLATE 170 171 #include "../../../../lib/inflate.c" 171 172 172 173 static inline void scroll(void)
+2
lib/inflate.c
··· 103 103 the two sets of lengths. 104 104 */ 105 105 #include <linux/compiler.h> 106 + #ifdef NO_INFLATE_MALLOC 106 107 #include <linux/slab.h> 108 + #endif 107 109 108 110 #ifdef RCSID 109 111 static char rcsid[] = "#Id: inflate.c,v 0.14 1993/06/10 13:27:04 jloup Exp #";