diff options
author | Antonio Quartulli <antonio@meshcoding.com> | 2014-05-24 06:43:47 +0200 |
---|---|---|
committer | Antonio Quartulli <antonio@meshcoding.com> | 2014-08-04 16:02:10 +0200 |
commit | 0185dda640a704ce41ca1489c6775451c5ff3dcf (patch) | |
tree | fd50f60be3bc3c506618f13c14d4a1794414ff19 /net/batman-adv/hash.c | |
parent | e6b92c25d20c64c271ef429bba8febeefb848b5b (diff) | |
download | linux-0185dda640a704ce41ca1489c6775451c5ff3dcf.tar.bz2 |
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) if (!hash) return NULL; - hash->table = kmalloc(sizeof(*hash->table) * size, GFP_ATOMIC); + hash->table = kmalloc_array(size, sizeof(*hash->table), GFP_ATOMIC); if (!hash->table) goto free_hash; - hash->list_locks = kmalloc(sizeof(*hash->list_locks) * size, - GFP_ATOMIC); + hash->list_locks = kmalloc_array(size, sizeof(*hash->list_locks), + GFP_ATOMIC); if (!hash->list_locks) goto free_table; |