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

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 <albin.tonnerre@free-electrons.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Cc: Phillip Lougher <phillip@lougher.demon.co.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Albin Tonnerre and committed by
Linus Torvalds
9e5cf0ca b1af4315

+3 -3
+1 -1
lib/decompress_bunzip2.c
··· 49 49 #define PREBOOT 50 50 #else 51 51 #include <linux/decompress/bunzip2.h> 52 + #include <linux/slab.h> 52 53 #endif /* STATIC */ 53 54 54 55 #include <linux/decompress/mm.h> 55 - #include <linux/slab.h> 56 56 57 57 #ifndef INT_MAX 58 58 #define INT_MAX 0x7fffffff
+1 -1
lib/decompress_inflate.c
··· 19 19 #include "zlib_inflate/inflate.h" 20 20 21 21 #include "zlib_inflate/infutil.h" 22 + #include <linux/slab.h> 22 23 23 24 #endif /* STATIC */ 24 25 25 26 #include <linux/decompress/mm.h> 26 - #include <linux/slab.h> 27 27 28 28 #define GZIP_IOBUF_SIZE (16*1024) 29 29
+1 -1
lib/decompress_unlzma.c
··· 33 33 #define PREBOOT 34 34 #else 35 35 #include <linux/decompress/unlzma.h> 36 + #include <linux/slab.h> 36 37 #endif /* STATIC */ 37 38 38 39 #include <linux/decompress/mm.h> 39 - #include <linux/slab.h> 40 40 41 41 #define MIN(a, b) (((a) < (b)) ? (a) : (b)) 42 42