From: Joe Perches <joe@perches.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, Julia Lawall <julia.lawall@lip6.fr>
Subject: Re: [PATCH] scripts: Add device_attr_<rw|ro|wr>.pl scripts to convert DEVICE_ATTR uses
Date: Tue, 02 Jan 2018 07:34:30 -0800 [thread overview]
Message-ID: <1514907270.31497.0.camel@perches.com> (raw)
In-Reply-To: <20171223141929.GA6228@kroah.com>
On Sat, 2017-12-23 at 15:19 +0100, Greg Kroah-Hartman wrote:
> On Fri, Dec 22, 2017 at 12:02:47PM -0800, Joe Perches wrote:
> > There are many uses of the DEVICE_ATTR(var, perms, show, store)
> > declaration macro that could use one of the convenience macros
> > DEVICE_ATTR_RW, DEVICE_ATTR_RO, or DEVICE_ATTR_WO.
> >
> > These scripts automate those conversions.
Hey Greg. Are you going to use these scripts?
> > Many declarations of functions used to show or store the values
> > do not use the <var>_show and <var>_store form. These scripts
> > also check to see if the normal form is unused in the file, that
> > the currently named functions are static and only used as the
> > function definition and the macro declaration and convert the
> > unusual function name to the more normal style.
> >
> > Use these scripts with a list of files to be converted.
> >
> > e.g.: git ls-files -- "*.c" | xargs perl -i scripts/device_attr_rw.pl
> >
> > Here are the current uses of DEVICE_ATTR macros in next-20171222
> >
> > $ git grep -w -P "DEVICE_ATTR(_RW|_RO|_WO|)" -- "*.c" | wc -l
> > 3393
> > $ git grep -w -P "DEVICE_ATTR" -- "*.c" | wc -l
> > 2052
> > $ git grep -w -P "DEVICE_ATTR_RW" -- "*.c" | wc -l
> > 456
> > $ git grep -w -P "DEVICE_ATTR_RO" -- "*.c" | wc -l
> > 821
> > $ git grep -w -P "DEVICE_ATTR_WO" -- "*.c" | wc -l
> > 64
> >
> > If these scripts on run on that tag, there are 1490 conversions done
> >
> > $ git grep -w --name-only DEVICE_ATTR -- "*.c" | \
> > xargs perl -i scripts/device_attr_rw.pl
> > $ git grep -w --name-only DEVICE_ATTR -- "*.c" | \
> > xargs perl -i scripts/device_attr_ro.pl
> > $ git grep -w --name-only DEVICE_ATTR -- "*.c" | \
> > xargs perl -i scripts/device_attr_wo.pl
> >
> > $ git grep -w -P "DEVICE_ATTR(_RW|_RO|_WO|)" -- "*.c" | wc -l
> > 3393
> > $ git grep -w -P "DEVICE_ATTR" -- "*.c" | wc -l
> > 562
> > $ git grep -w -P "DEVICE_ATTR_RW" -- "*.c" | wc -l
> > 924
> > $ git grep -w -P "DEVICE_ATTR_RO" -- "*.c" | wc -l
> > 1727
> > $ git grep -w -P "DEVICE_ATTR_WO" -- "*.c" | wc -l
> > 180
> >
> > Signed-off-by: Joe Perches <joe@perches.com>
> >
> > 1727
> > ith '#' will be ignored, and an empty message aborts the commit.
> > ---
> > scripts/device_attr_ro.pl | 57 ++++++++++++++++++++++++++++++++++++++++
> > scripts/device_attr_rw.pl | 66 +++++++++++++++++++++++++++++++++++++++++++++++
> > scripts/device_attr_wo.pl | 57 ++++++++++++++++++++++++++++++++++++++++
>
> We should just fix up all in-kernel users, no need to put the scripts in
> the kernel source tree, right?
>
> thanks,
>
> greg k-h
next prev parent reply other threads:[~2018-01-02 15:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-22 20:02 [PATCH] scripts: Add device_attr_<rw|ro|wr>.pl scripts to convert DEVICE_ATTR uses Joe Perches
2017-12-23 14:19 ` Greg Kroah-Hartman
2017-12-23 14:24 ` Joe Perches
2018-01-02 15:34 ` Joe Perches [this message]
2018-01-02 15:47 ` Greg Kroah-Hartman
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=1514907270.31497.0.camel@perches.com \
--to=joe@perches.com \
--cc=gregkh@linuxfoundation.org \
--cc=julia.lawall@lip6.fr \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.