summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorAlexander Stein <alexander.stein@systec-electronic.com>2016-03-17 11:00:27 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2016-04-08 13:33:18 +0200
commitee87c0e70caa4f8c2c66a942b0895e7ed61ad56b (patch)
tree344899613be758e5bd2bf4280773c32299a7f686 /include/linux
parent5273fb0dd50e265674be439b3d7f17947b716ad4 (diff)
downloadbarebox-ee87c0e70caa4f8c2c66a942b0895e7ed61ad56b.tar.gz
barebox-ee87c0e70caa4f8c2c66a942b0895e7ed61ad56b.tar.xz
barebox-wrapper: Implement kfree and vfree as static inline functions
If kfree/vfree is called where free is a already variable name, code will not compile. Also both take a const* in Linux kernel code. Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/barebox-wrapper.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/linux/barebox-wrapper.h b/include/linux/barebox-wrapper.h
index fc1b5c2d41..67b332e6e1 100644
--- a/include/linux/barebox-wrapper.h
+++ b/include/linux/barebox-wrapper.h
@@ -1,14 +1,21 @@
#ifndef __INCLUDE_LINUX_BAREBOX_WRAPPER_H
#define __INCLUDE_LINUX_BAREBOX_WRAPPER_H
+#include <malloc.h>
#include <xfuncs.h>
#define kmalloc(len, mode) malloc(len)
#define kzalloc(len, mode) xzalloc(len)
#define vmalloc(len) malloc(len)
-#define kfree(ptr) free(ptr)
+static inline void kfree(const void *block)
+{
+ free((void *)block);
+}
#define vzalloc(len) kzalloc(len, 0)
-#define vfree(ptr) free(ptr)
+static inline void vfree(const void *addr)
+{
+ free((void *)addr);
+}
#define KERN_EMERG "" /* system is unusable */
#define KERN_ALERT "" /* action must be taken immediately */