[v2] batman-adv: add compat code for kmalloc_array()

Message ID 1402651269-19233-1-git-send-email-antonio@meshcoding.com (mailing list archive)
State Accepted, archived
Headers

Commit Message

Antonio Quartulli June 13, 2014, 9:21 a.m. UTC
  kmalloc_array() was introduced with linux-3.4 therefore
we need some compat code in order to be able to compile
batman-adv against older kernels.

Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
---

Changes from v2:
- fix linux version in commit message



 compat.h | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Marek Lindner June 14, 2014, 1:56 a.m. UTC | #1
On Friday 13 June 2014 11:21:09 Antonio Quartulli wrote:
> kmalloc_array() was introduced with linux-3.4 therefore
> we need some compat code in order to be able to compile
> batman-adv against older kernels.
> 
> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
> ---
> 
> Changes from v2:
> - fix linux version in commit message
> 
> 
> 
>  compat.h | 2 ++
>  1 file changed, 2 insertions(+)

Applied in revision c38939d.

Thanks,
Marek
  

Patch

diff --git a/compat.h b/compat.h
index 5eb5fe6..28f4cfe 100644
--- a/compat.h
+++ b/compat.h
@@ -274,6 +274,8 @@  static inline void batadv_eth_hw_addr_random(struct net_device *dev)
 	random_ether_addr(dev->dev_addr);
 }
 
+#define kmalloc_array(n, size, flags) kmalloc(n * size, flags)
+
 #endif /* < KERNEL_VERSION(3, 4, 0) */
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 5, 0)