mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: linux-kernel@vger.kernel.org
Subject: [-next PATCH 1/4] sysfs.h: Use octal permissions
Date: Tue, 19 Dec 2017 10:15:06 -0800	[thread overview]
Message-ID: <42ce593cf9b218be22cbd47ea339cf71d3e87a8f.1513706701.git.joe@perches.com> (raw)
In-Reply-To: <cover.1513706701.git.joe@perches.com>

Use the more common and preferred octal directly.

Signed-off-by: Joe Perches <joe@perches.com>
---
 include/linux/sysfs.h | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 40839c02d28c..b8bfdc173ec0 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -113,7 +113,7 @@ struct attribute_group {
 }
 
 #define __ATTR_RO(_name) {						\
-	.attr	= { .name = __stringify(_name), .mode = S_IRUGO },	\
+	.attr	= { .name = __stringify(_name), .mode = 0444 },		\
 	.show	= _name##_show,						\
 }
 
@@ -124,12 +124,11 @@ struct attribute_group {
 }
 
 #define __ATTR_WO(_name) {						\
-	.attr	= { .name = __stringify(_name), .mode = S_IWUSR },	\
+	.attr	= { .name = __stringify(_name), .mode = 0200 },		\
 	.store	= _name##_store,					\
 }
 
-#define __ATTR_RW(_name) __ATTR(_name, (S_IWUSR | S_IRUGO),		\
-			 _name##_show, _name##_store)
+#define __ATTR_RW(_name) __ATTR(_name, 0644, _name##_show, _name##_store)
 
 #define __ATTR_NULL { .attr = { .name = NULL } }
 
@@ -192,14 +191,13 @@ struct bin_attribute {
 }
 
 #define __BIN_ATTR_RO(_name, _size) {					\
-	.attr	= { .name = __stringify(_name), .mode = S_IRUGO },	\
+	.attr	= { .name = __stringify(_name), .mode = 0444 },		\
 	.read	= _name##_read,						\
 	.size	= _size,						\
 }
 
-#define __BIN_ATTR_RW(_name, _size) __BIN_ATTR(_name,			\
-				   (S_IWUSR | S_IRUGO), _name##_read,	\
-				   _name##_write, _size)
+#define __BIN_ATTR_RW(_name, _size)					\
+	__BIN_ATTR(_name, 0644, _name##_read, _name##_write, _size)
 
 #define __BIN_ATTR_NULL __ATTR_NULL
 
-- 
2.15.0

  reply	other threads:[~2017-12-19 18:15 UTC|newest]

Thread overview: 26+ 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 ` Joe Perches [this message]
2017-12-19 18:15 ` [-next PATCH 2/4] treewide: Use DEVICE_ATTR_RW Joe Perches
2017-12-19 18:41   ` Andy Shevchenko
2017-12-20  8:34   ` Jarkko Nikula
2017-12-20  9:24     ` Joe Perches
2017-12-20  9:32       ` Greg Kroah-Hartman
2017-12-20  9:54         ` Joe Perches
2017-12-20  9:59           ` Greg Kroah-Hartman
2017-12-20 10:55             ` Joe Perches
2017-12-20 13:26               ` Julia Lawall
2017-12-20 10:54         ` Jarkko Nikula
2018-01-10 14:43           ` Peter Ujfalusi
2017-12-21  0:47   ` Zhang Rui
2018-01-03 15:16   ` Bartlomiej Zolnierkiewicz
2017-12-19 18:15 ` [-next PATCH 3/4] treewide: Use DEVICE_ATTR_RO Joe Perches
2017-12-21  0:48   ` Zhang Rui
     [not found]   ` <20171221093410.ygvupz3azaccxgnb@valkosipuli.retiisi.org.uk>
2018-01-09 15:34     ` Greg Kroah-Hartman
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
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=42ce593cf9b218be22cbd47ea339cf71d3e87a8f.1513706701.git.joe@perches.com \
    --to=joe@perches.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®