tun/tap: use paren's with sizeof
authorstephen hemminger <stephen@networkplumber.org>
Tue, 15 Aug 2017 17:29:16 +0000 (10:29 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Aug 2017 18:01:57 +0000 (11:01 -0700)
Although sizeof is an operator in C. The kernel coding style convention
is to always use it like a function and add parenthesis.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tap.c
drivers/net/tun.c

index 0d039411e64c2cba5c2a88fe8c47bfeb514534b8..21b71ae947fdbc2e3bbf7d5ef7c17d17aa560ba2 100644 (file)
@@ -1215,7 +1215,7 @@ int tap_queue_resize(struct tap_dev *tap)
        int n = tap->numqueues;
        int ret, i = 0;
 
-       arrays = kmalloc(sizeof *arrays * n, GFP_KERNEL);
+       arrays = kmalloc_array(n, sizeof(*arrays), GFP_KERNEL);
        if (!arrays)
                return -ENOMEM;
 
index 5892284eb8d05b0678d820bad3d0d2c61a879aeb..f5017121cd57095b275459caf1cb61d66e77c250 100644 (file)
@@ -2737,7 +2737,7 @@ static int tun_queue_resize(struct tun_struct *tun)
        int n = tun->numqueues + tun->numdisabled;
        int ret, i;
 
-       arrays = kmalloc(sizeof *arrays * n, GFP_KERNEL);
+       arrays = kmalloc_array(n, sizeof(*arrays), GFP_KERNEL);
        if (!arrays)
                return -ENOMEM;