Skip to content

Commit

Permalink
tun/tap: use paren's with sizeof
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
shemminger authored and davem330 committed Aug 16, 2017
1 parent 6b0355f commit 1203904
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/net/tap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 1203904

Please sign in to comment.