lkml.org 
[lkml]   [2018]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/4] decompression: Rename malloc and free
Date
From: Matthew Wilcox <mawilcox@microsoft.com>

Rename the trivial malloc and free implementations to tmalloc and tfree
to avoid a namespace collision with an in-kernel free() function.

Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
---
include/linux/decompress/mm.h | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/include/linux/decompress/mm.h b/include/linux/decompress/mm.h
index 868e9eacd69e..0ac62b025c1b 100644
--- a/include/linux/decompress/mm.h
+++ b/include/linux/decompress/mm.h
@@ -31,7 +31,7 @@
STATIC_RW_DATA unsigned long malloc_ptr;
STATIC_RW_DATA int malloc_count;

-static void *malloc(int size)
+static void *tmalloc(int size)
{
void *p;

@@ -52,15 +52,17 @@ static void *malloc(int size)
return p;
}

-static void free(void *where)
+static void tfree(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 malloc(a) tmalloc(a)
+#define free(a) tfree(a)
+#define large_malloc(a) tmalloc(a)
+#define large_free(a) tfree(a)

#define INIT

--
2.16.2
\
 
 \ /
  Last update: 2018-03-22 20:58    [W:1.272 / U:1.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site