From: Joe Perches <joe@perches.com>
To: David Miller <davem@davemloft.net>, thomas@m3y3r.de
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ipv6: sr: Use ARRAY_SIZE macro
Date: Fri, 01 Sep 2017 20:51:55 -0700 [thread overview]
Message-ID: <1504324315.2361.25.camel@perches.com> (raw)
In-Reply-To: <20170901.183540.2023957151661748902.davem@davemloft.net>
On Fri, 2017-09-01 at 18:35 -0700, David Miller wrote:
> From: Thomas Meyer <thomas@m3y3r.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(-)
next prev parent reply other threads:[~2017-09-02 3:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-31 14:18 [PATCH] ipv6: sr: Use ARRAY_SIZE macro Thomas Meyer
2017-09-02 1:35 ` David Miller
2017-09-02 3:51 ` Joe Perches [this message]
2017-09-02 6:24 ` Thomas Meyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1504324315.2361.25.camel@perches.com \
--to=joe@perches.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=thomas@m3y3r.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).