diff options
author | Antonio Quartulli <antonio@meshcoding.com> | 2014-05-24 00:43:47 -0400 |
---|---|---|
committer | Antonio Quartulli <antonio@meshcoding.com> | 2014-08-04 10:02:10 -0400 |
commit | 0185dda640a704ce41ca1489c6775451c5ff3dcf (patch) | |
tree | fd50f60be3bc3c506618f13c14d4a1794414ff19 /net/batman-adv/hash.c | |
parent | e6b92c25d20c64c271ef429bba8febeefb848b5b (diff) |
batman-adv: prefer kmalloc_array to kmalloc when possible
Reported by checkpatch with the following warning:
WARNING: Prefer kmalloc_array over kmalloc with multiply
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Diffstat (limited to 'net/batman-adv/hash.c')
-rw-r--r-- | net/batman-adv/hash.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/batman-adv/hash.c b/net/batman-adv/hash.c index 63bdf7e94f1e..7c1c63080e20 100644 --- a/net/batman-adv/hash.c +++ b/net/batman-adv/hash.c | |||
@@ -46,12 +46,12 @@ struct batadv_hashtable *batadv_hash_new(uint32_t size) | |||
46 | if (!hash) | 46 | if (!hash) |
47 | return NULL; | 47 | return NULL; |
48 | 48 | ||
49 | hash->table = kmalloc(sizeof(*hash->table) * size, GFP_ATOMIC); | 49 | hash->table = kmalloc_array(size, sizeof(*hash->table), GFP_ATOMIC); |
50 | if (!hash->table) | 50 | if (!hash->table) |
51 | goto free_hash; | 51 | goto free_hash; |
52 | 52 | ||
53 | hash->list_locks = kmalloc(sizeof(*hash->list_locks) * size, | 53 | hash->list_locks = kmalloc_array(size, sizeof(*hash->list_locks), |
54 | GFP_ATOMIC); | 54 | GFP_ATOMIC); |
55 | if (!hash->list_locks) | 55 | if (!hash->list_locks) |
56 | goto free_table; | 56 | goto free_table; |
57 | 57 | ||