[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1504324315.2361.25.camel@perches.com>
Date: Fri, 01 Sep 2017 20:51:55 -0700
From: Joe Perches <joe@...ches.com>
To: David Miller <davem@...emloft.net>, thomas@...3r.de
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ipv6: sr: Use ARRAY_SIZE macro
On Fri, 2017-09-01 at 18:35 -0700, David Miller wrote:
> From: Thomas Meyer <thomas@...3r.de>
> Date: Thu, 31 Aug 2017 16:18:15 +0200
>
> > Grepping for "sizeof\(.+\) / sizeof\(" found this as one of the first
> > candidates.
> > Maybe a coccinelle can catch all of those.
Umm: try scripts/coccinelle/misc/array_size.cocci
Until then, maybe a perl script?
$ git grep --name-only sizeof.*/.*sizeof drivers/net | \
xargs perl -p -i -e 's/\bsizeof\s*\(\s*(\w+)\s*\)\s*\/\s*sizeof\s*\(\s*\1\s*\[\s*0\s*\]\s*\)/ARRAY_SIZE(\1)/g'
gives:
$ git diff --stat drivers/net
drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | 2 +-
drivers/net/ethernet/mellanox/mlx4/fw.c | 4 +--
drivers/net/ethernet/mellanox/mlx4/main.c | 8 +++---
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 2 +-
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phytbl_n.c | 186 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------------------------------------------------------
5 files changed, 101 insertions(+), 101 deletions(-)
Powered by blists - more mailing lists