All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Veldeman <jan@mind.be>
To: kernel-janitors@vger.kernel.org
Subject: [KJ] [PATCH] Driver core: Documentation: use S_IRUSR | ... in stead
Date: Fri, 22 Jul 2005 08:19:29 +0000	[thread overview]
Message-ID: <20050722081929.GA5465@fanta> (raw)
In-Reply-To: <20050721204958.GA24421@fanta>

[-- Attachment #1: Type: text/plain, Size: 1023 bytes --]


Walter Harms wrote:
[...]
> >+static DEVICE_ATTR(foo, 0644, show_foo, store_foo);
> > 
> 
> just a bit nitpicking ...
>  0644 magic number in examples are bad (even when most kernelhacker 
> know was they mean).
[...]


As we're at it and on request from Walter Harms, also fix the file mode to
use the defines in stead of 0644.


Signed-off-by: Jan Veldeman <Jan.Veldeman@advalvas.be>


diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt
--- a/Documentation/filesystems/sysfs.txt
+++ b/Documentation/filesystems/sysfs.txt
@@ -99,14 +99,15 @@ struct device_attribute dev_attr_##_name
 
 For example, declaring
 
-static DEVICE_ATTR(foo, 0644, show_foo, store_foo);
+static DEVICE_ATTR(foo, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, show_foo,
+		   store_foo);
 
 is equivalent to doing:
 
 static struct device_attribute dev_attr_foo = {
        .attr	= {
 		.name = "foo",
-		.mode = 0644,
+		.mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH,
 	},
 	.show = show_foo,
 	.store = store_foo,


[-- Attachment #2: Type: text/plain, Size: 168 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

  parent reply	other threads:[~2005-07-22  8:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-21 20:49 [KJ] [PATCH] Driver core: Documentation: use snprintf and strnlen Jan Veldeman
2005-07-21 21:54 ` [KJ] [PATCH] Driver core: Documentation: fix whitespace between Jan Veldeman
2005-07-22  8:19 ` Jan Veldeman [this message]
2005-07-22  9:41 ` [KJ] [PATCH] Driver core: Documentation: use S_IRUSR | ... in stead Jan Veldeman

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=20050722081929.GA5465@fanta \
    --to=jan@mind.be \
    --cc=kernel-janitors@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.