summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-03-29 13:07:09 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-04-08 13:33:18 +0200
commit3bafe5eac5b48193607c4617f32d9e5e2075189f (patch)
treea9a524dae075f47b4b5b9ac8896fec4fe34410a1 /include/linux
parent68bd0e50360fd97914e0716f4c9d81ceb980e3ba (diff)
downloadbarebox-3bafe5eac5b48193607c4617f32d9e5e2075189f.tar.gz
barebox-3bafe5eac5b48193607c4617f32d9e5e2075189f.tar.xz
decompressors: Use malloc/free wrappers
The decompressors are used both in a regular image and also for image decompression. Both need different malloc implementations. Using malloc/free directly in the decompressor code easily leads to include file conflicts, so use MALLOC/FREE which can be defined correctly for the two different usecases. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/decompress/mm.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/linux/decompress/mm.h b/include/linux/decompress/mm.h
index 0c354110c0..81676ae906 100644
--- a/include/linux/decompress/mm.h
+++ b/include/linux/decompress/mm.h
@@ -30,7 +30,7 @@
STATIC_RW_DATA unsigned long malloc_ptr;
STATIC_RW_DATA int malloc_count;
-static void *malloc(int size)
+static __maybe_unused void *simple_malloc(int size)
{
void *p;
@@ -51,15 +51,18 @@ static void *malloc(int size)
return p;
}
-static void free(void *where)
+static __maybe_unused void simple_free(void *where)
{
malloc_count--;
if (!malloc_count)
malloc_ptr = free_mem_ptr;
}
-#define large_malloc(a) malloc(a)
-#define large_free(a) free(a)
+#define large_malloc(a) simple_malloc(a)
+#define large_free(a) simple_free(a)
+
+#define MALLOC simple_malloc
+#define FREE simple_free
#define INIT