From: Joe Perches <joe@perches.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>,
Thomas Falcon <tlfalcon@linux.vnet.ibm.com>,
John Allen <jallen@linux.vnet.ibm.com>,
Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>,
linux-wimax@intel.com, James Smart <james.smart@broadcom.com>,
Dick Kennedy <dick.kennedy@broadcom.com>,
Zhang Rui <rui.zhang@intel.com>,
Eduardo Valentin <edubezval@gmail.com>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, Dmitry Torokhov <dmitry.torokhov@gmail.com>,
"James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Subject: Re: [-next PATCH 4/4] treewide: Use DEVICE_ATTR_WO
Date: Tue, 19 Dec 2017 10:51:14 -0800 [thread overview]
Message-ID: <1513709474.1234.66.camel@perches.com> (raw)
In-Reply-To: <20171219184441.ixxh757tl44qvk5l@pd.tnic>
On Tue, 2017-12-19 at 19:44 +0100, Borislav Petkov wrote:
> On Tue, Dec 19, 2017 at 10:15:09AM -0800, Joe Perches wrote:
> > Convert DEVICE_ATTR uses to DEVICE_ATTR_WO where possible.
> >
> > Done with perl script:
> >
> > $ git grep -w --name-only DEVICE_ATTR | \
> > xargs perl -i -e 'local $/; while (<>) { s/\bDEVICE_ATTR\s*\(\s*(\w+)\s*,\s*\(?(?:\s*S_IWUSR\s*|\s*0200\s*)\)?\s*,\s*NULL\s*,\s*\s_store\s*\)/DEVICE_ATTR_WO(\1)/g; print;}'
[]
> > diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
[]
> > @@ -560,7 +560,7 @@ static ssize_t pf_show(struct device *dev,
> > return sprintf(buf, "0x%x\n", uci->cpu_sig.pf);
> > }
> >
> > -static DEVICE_ATTR(reload, 0200, NULL, reload_store);
> > +static DEVICE_ATTR_WO(reload);
> > static DEVICE_ATTR(version, 0400, version_show, NULL);
> > static DEVICE_ATTR(processor_flags, 0400, pf_show, NULL);
> >
>
> # cat /sys/devices/system/cpu/microcode/reload
> cat: /sys/devices/system/cpu/microcode/reload: Permission denied
Not different behavior. It was and remains write only.
> The reason for the code churn being?
Consistency for easier grep by use-type.
next prev parent reply other threads:[~2017-12-19 18:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-19 18:15 [-next PATCH 0/4] sysfs and DEVICE_ATTR_<foo> Joe Perches
2017-12-19 18:15 ` [-next PATCH 4/4] treewide: Use DEVICE_ATTR_WO Joe Perches
2017-12-19 18:44 ` Borislav Petkov
2017-12-19 18:51 ` Joe Perches [this message]
2017-12-19 18:54 ` Borislav Petkov
2017-12-21 0:50 ` Zhang Rui
2017-12-19 18:54 ` [-next PATCH 0/4] sysfs and DEVICE_ATTR_<foo> Jani Nikula
2017-12-19 19:26 ` Corey Minyard
2017-12-20 9:46 ` Felipe Balbi
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=1513709474.1234.66.camel@perches.com \
--to=joe@perches.com \
--cc=benh@kernel.crashing.org \
--cc=bp@alien8.de \
--cc=dick.kennedy@broadcom.com \
--cc=dmitry.torokhov@gmail.com \
--cc=edubezval@gmail.com \
--cc=heiko.carstens@de.ibm.com \
--cc=hpa@zytor.com \
--cc=inaky.perez-gonzalez@intel.com \
--cc=jallen@linux.vnet.ibm.com \
--cc=james.smart@broadcom.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-wimax@intel.com \
--cc=martin.petersen@oracle.com \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
--cc=rui.zhang@intel.com \
--cc=schwidefsky@de.ibm.com \
--cc=tglx@linutronix.de \
--cc=tlfalcon@linux.vnet.ibm.com \
--cc=x86@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 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).