From: Johannes Berg Date: Sat, 13 Apr 2013 13:29:37 +0000 (+0200) Subject: backports: avoid vfree() const warning X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=e6f5a6a71d8309adc9d26553b9bf005bbd190527;p=openwrt%2Fstaging%2Fblogic.git backports: avoid vfree() const warning 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 --- diff --git a/backport/backport-include/linux/vmalloc.h b/backport/backport-include/linux/vmalloc.h index c47536ff2f54..9e8ff3bcd535 100644 --- a/backport/backport-include/linux/vmalloc.h +++ b/backport/backport-include/linux/vmalloc.h @@ -3,6 +3,12 @@ #include_next #include +/* 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);