From: Johannes Berg <[email protected]>

On newer kernels const pointers can be passed to vfree()
and vunmap(), doing so on old kernels causes warnings
that we can suppress with a cast.

Signed-off-by: Johannes Berg <[email protected]>
---
 backport/backport-include/linux/vmalloc.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/backport/backport-include/linux/vmalloc.h 
b/backport/backport-include/linux/vmalloc.h
index c47536f..9e8ff3b 100644
--- a/backport/backport-include/linux/vmalloc.h
+++ b/backport/backport-include/linux/vmalloc.h
@@ -3,6 +3,12 @@
 #include_next <linux/vmalloc.h>
 #include <linux/version.h>
 
+/* avoid warnings due to b3bdda02aa547a0753b4fdbc105e86ef9046b30b */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
+#define vfree(ptr) vfree((void *)(ptr))
+#define vunmap(ptr) vunmap((void *)(ptr))
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
 #define vzalloc LINUX_BACKPORT(vzalloc)
 extern void *vzalloc(unsigned long size);
-- 
1.8.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to