From: Joe Perches <joe@perches.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Julia Lawall <julia.lawall@lip6.fr>
Cc: Jarkko Nikula <jarkko.nikula@bitmer.com>,
Jani Nikula <jani.nikula@linux.intel.com>,
Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
Cezary Jackiewicz <cezary.jackiewicz@gmail.com>,
Darren Hart <dvhart@infradead.org>,
Andy Shevchenko <andy@infradead.org>,
Sebastian Ott <sebott@linux.vnet.ibm.com>,
Peter Oberparleiter <oberpar@linux.vnet.ibm.com>,
James Smart <james.smart@broadcom.com>,
Dick Kennedy <dick.kennedy@broadcom.com>,
Zhang Rui <rui.zhang@intel.com>,
Eduardo Valentin <edubezval@gmail.com>,
Mathias Nyman <mathias.nyman@intel.com>,
Felipe Balbi <balbi@kernel.org>,
"Luis R. Rodriguez" <mcgrof@kernel.org>,
Peter Ujfalusi <peter.ujfalusi@ti.com>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
David Airlie <airlied@linux.ie>,
"James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Jiri Slaby <jslaby@suse.com>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>,
linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
platform-driver-x86@vger.kernel.org, linux-scsi@vger.kernel.org,
linux-pm@vger.kernel.org, linux-serial@vger.kernel.org,
linux-usb@vger.kernel.org, linux-fbdev@vger.kernel.org,
alsa-devel@alsa-project.org, linux-omap@vger.kernel.org
Subject: [-next,2/4] treewide: Use DEVICE_ATTR_RW
Date: Wed, 20 Dec 2017 02:55:07 -0800 [thread overview]
Message-ID: <1513767307.1234.114.camel@perches.com> (raw)
On Wed, 2017-12-20 at 10:59 +0100, Greg Kroah-Hartman wrote:
> > > Why you didn't send that patch to the sysfs maintainer is a bit odd... :)
> >
> > So here's an opportunity for you:
> >
> > The sysfs maintainer hasn't added include/linux/sysfs.h to
> > the list of maintained files...
> >
> > DRIVER CORE, KOBJECTS, DEBUGFS AND SYSFS
> > M: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git
> > S: Supported
> > F: Documentation/kobject.txt
> > F: drivers/base/
> > F: fs/debugfs/
> > F: fs/sysfs/
> > F: include/linux/debugfs.h
> > F: include/linux/kobj*
> > F: lib/kobj*
>
> Heh, good point, but using get_maintainer.pl does put me at the top of
> the list that you should be cc:ing:
>
> $ ./scripts/get_maintainer.pl --file include/linux/sysfs.h
> Greg Kroah-Hartman <gregkh@linuxfoundation.org> (commit_signer:3/3=100%,authored:2/3=67%,added_lines:7/8=88%)
> Kate Stewart <kstewart@linuxfoundation.org> (commit_signer:1/3=33%)
> Thomas Gleixner <tglx@linutronix.de> (commit_signer:1/3=33%)
> Philippe Ombredanne <pombredanne@nexb.com> (commit_signer:1/3=33%)
> Nick Desaulniers <nick.desaulniers@gmail.com> (commit_signer:1/3=33%,authored:1/3=33%,added_lines:1/8=12%,removed_lines:1/1=100%)
> linux-kernel@vger.kernel.org (open list)
The script I use to send patches adds --nogit --nogit-fallback
to copy only listed maintainers because people that send cleanup
patches don't generally like to get random patches.
> > btw: there are many uses of a reversed declaration style of DEVICE_ATTR
> >
> > Here's another thing that could be done for more DEVICE_ATTR_<FOO> uses.
> >
> > ===
> >
> > Some DEVICE_ATTR definitions use a reversed static function form from
> > the typical. Convert them to use the more common macro form so it is
> > easier to grep for the style.
[]
> > $ git grep --name-only -w DEVICE_ATTR | \
> > xargs perl -i dev_attr_rw_backwards.perl
> Ah, nice, I love perl :
That was a bad copy/paste of the script.
The actual script for RW is:
$ cat dev_attr_rw_backwards.perl
local $/;
while (<>) {
my $file = $_;
while ($file =~ m/\bDEVICE_ATTR\s*\(\s*(\w+)\s*,/g) {
my $var = $1;
if ($file =~ s/\bDEVICE_ATTR\s*\(\s*${var}\s*,\s*\(?(\s*S_IRUGO\s*\|\s*S_IWUSR|\s*S_IWUSR\s*\|\s*S_IRUGO\s*|\s*0644\s*)\)?\s*,\s*show_${var}\s*,\s*store_${var}\s*\)/DEVICE_ATTR_RW(${var})/g) {
$file =~ s/\bshow_${var}\b/${var}_show/g;
$file =~ s/\bstore_${var}\b/${var}_store/g;
}
}
print $file;
}
There are 3 different perl scripts for rw, ro, and wo.
and these scripts, because of function renaming and
possible reuse of the original function names by other
string concatenated macros, create some bad conversions
so they need some manual cleanups too.
Perhaps coccinelle could do a better job of it, but
likely string concatenation macro uses are going to
be hard to deal with in any case.
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2017-12-20 10:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-20 10:55 Joe Perches [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-01-10 14:43 [-next,2/4] treewide: Use DEVICE_ATTR_RW Peter Ujfalusi
2018-01-03 15:16 Bartlomiej Zolnierkiewicz
2017-12-21 0:47 Zhang, Rui
2017-12-20 13:26 Julia Lawall
2017-12-20 10:54 Jarkko Nikula
2017-12-20 9:59 Greg Kroah-Hartman
2017-12-20 9:54 Joe Perches
2017-12-20 9:32 Greg Kroah-Hartman
2017-12-20 9:24 Joe Perches
2017-12-20 8:34 Jarkko Nikula
2017-12-19 18:41 Andy Shevchenko
2017-12-19 18:15 Joe Perches
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=1513767307.1234.114.camel@perches.com \
--to=joe@perches.com \
--cc=airlied@linux.ie \
--cc=alsa-devel@alsa-project.org \
--cc=andy@infradead.org \
--cc=b.zolnierkie@samsung.com \
--cc=balbi@kernel.org \
--cc=broonie@kernel.org \
--cc=cezary.jackiewicz@gmail.com \
--cc=dick.kennedy@broadcom.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=dvhart@infradead.org \
--cc=edubezval@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=heiko.carstens@de.ibm.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=james.smart@broadcom.com \
--cc=jani.nikula@linux.intel.com \
--cc=jarkko.nikula@bitmer.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=jslaby@suse.com \
--cc=julia.lawall@lip6.fr \
--cc=lgirdwood@gmail.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mathias.nyman@intel.com \
--cc=mcgrof@kernel.org \
--cc=oberpar@linux.vnet.ibm.com \
--cc=perex@perex.cz \
--cc=peter.ujfalusi@ti.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=rodrigo.vivi@intel.com \
--cc=rui.zhang@intel.com \
--cc=schwidefsky@de.ibm.com \
--cc=sebott@linux.vnet.ibm.com \
--cc=tiwai@suse.com \
/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).