[RFC/RFT 39/42] backports: avoid vfree() const warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Johannes Berg <johannes.berg@xxxxxxxxx>

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 <johannes.berg@xxxxxxxxx>
---
 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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux