Blob Blame History Raw
From: stephen hemminger <stephen@networkplumber.org>
Date: Tue, 15 Aug 2017 10:29:16 -0700
Subject: tun/tap: use paren's with sizeof
Patch-mainline: v4.14-rc1
Git-commit: 120390468b38f04373e67dbc9f361e2bb2996691
References: bsc#1109837

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>
Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
 drivers/net/tap.c |    2 +-
 drivers/net/tun.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/net/tap.c
+++ b/drivers/net/tap.c
@@ -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;
 
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -2740,7 +2740,7 @@ static int tun_queue_resize(struct tun_s
 	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;