projects/linux·commit 9e5cf0ca

lib/decompress_*: only include <linux/slab.h> if STATIC is not defined

9e5cf0ca · Albin Tonnerre <[email protected]> · 2009-08-06 15:09:32 -07:00

These includes were added by 079effb6933f34b9b1b67b08bd4fd7fb672d16ef
("kmemtrace, kbuild: fix slab.h dependency problem in
lib/decompress_inflate.c") to fix the build when using kmemtrace.  However
this is not necessary when used to create a compressed kernel, and
actually creates issues (brings a lot of things unavailable in the
decompression environment), so don't include it if STATIC is defined.

Signed-off-by: Albin Tonnerre <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: Russell King <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: Pekka Enberg <[email protected]>
Cc: Eduard - Gabriel Munteanu <[email protected]>
Cc: Phillip Lougher <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
9e5cf0ca2e9b65110ae5f094d7f0f7165cd1bbbb
Parents
b1af4315

Changes

3 files changed · +3 −3

FileStatusAddDelContent
lib/decompress_bunzip2.cmodified+1−1View file
lib/decompress_inflate.cmodified+1−1View file
lib/decompress_unlzma.cmodified+1−1View file

lib/decompress_bunzip2.c

View file
diff --git a/lib/decompress_bunzip2.c b/lib/decompress_bunzip2.c
index d3dc9f2..600f473 100644
--- a/lib/decompress_bunzip2.c
+++ b/lib/decompress_bunzip2.c
@@ -49,10 +49,10 @@
#define PREBOOT
#else
#include <linux/decompress/bunzip2.h>
+#include <linux/slab.h>
#endif /* STATIC */
#include <linux/decompress/mm.h>
-#include <linux/slab.h>
#ifndef INT_MAX
#define INT_MAX 0x7fffffff

lib/decompress_inflate.c

View file
diff --git a/lib/decompress_inflate.c b/lib/decompress_inflate.c
index bfe605a..68dfce5 100644
--- a/lib/decompress_inflate.c
+++ b/lib/decompress_inflate.c
@@ -19,11 +19,11 @@
#include "zlib_inflate/inflate.h"
#include "zlib_inflate/infutil.h"
+#include <linux/slab.h>
#endif /* STATIC */
#include <linux/decompress/mm.h>
-#include <linux/slab.h>
#define GZIP_IOBUF_SIZE (16*1024)

lib/decompress_unlzma.c

View file
diff --git a/lib/decompress_unlzma.c b/lib/decompress_unlzma.c
index d3f9468..0b954e0 100644
--- a/lib/decompress_unlzma.c
+++ b/lib/decompress_unlzma.c
@@ -33,10 +33,10 @@
#define PREBOOT
#else
#include <linux/decompress/unlzma.h>
+#include <linux/slab.h>
#endif /* STATIC */
#include <linux/decompress/mm.h>
-#include <linux/slab.h>
#define MIN(a, b) (((a) < (b)) ? (a) : (b))