[Nouveau] [PATCH] module parameters: permissions as defines, readable to everyone
Ilia Mirkin
imirkin at alum.mit.edu
Sun Apr 10 16:58:08 UTC 2016
On Sun, Apr 10, 2016 at 12:45 PM, poma <pomidorabelisima at gmail.com> wrote:
>
> For the purposes of the module parameters,
> specifies the permissions of the corresponding files in sysfs in predefined S_I* form rather than in octal notation.
I definitely find octal *way* more readable for permissions than those
S_* macros. Apparently others agree with me, have a look at 'git grep
module_param_named drivers/gpu/drm' - note lack of the silly macros.
I'd be fine with flipping everything to 0444 though. Not sure why it
was so restrictive right now.
> Withal it makes the source code more consistent.
> Moreover, because all parameters are readable to everyone, it is more user-friendly.
>
> $ grep S_IRUGO include/linux/stat.h
> #define S_IRUGO (S_IRUSR|S_IRGRP|S_IROTH)
>
> $ grep 'S_IRUSR\|S_IRGRP\|S_IROTH' include/uapi/linux/stat.h
> #define S_IRUSR 00400
> #define S_IRGRP 00040
> #define S_IROTH 00004
>
> $ ls -l /sys/module/nouveau/parameters/
> total 0
> -r--r--r--. 1 root root 4096 Apr 10 17:43 config
> -r--r--r--. 1 root root 4096 Apr 10 17:43 debug
> -r--r--r--. 1 root root 4096 Apr 10 17:43 duallink
> -r--r--r--. 1 root root 4096 Apr 10 17:43 hdmimhz
> -r--r--r--. 1 root root 4096 Apr 10 17:43 ignorelid
> -r--r--r--. 1 root root 4096 Apr 10 17:43 modeset
> -r--r--r--. 1 root root 4096 Apr 10 17:43 noaccel
> -r--r--r--. 1 root root 4096 Apr 10 17:43 nofbaccel
> -r--r--r--. 1 root root 4096 Apr 10 17:43 runpm
> -r--r--r--. 1 root root 4096 Apr 10 17:43 tv_disable
> -r--r--r--. 1 root root 4096 Apr 10 17:43 tv_norm
> -r--r--r--. 1 root root 4096 Apr 10 17:43 vram_pushbuf
>
> $ systool -vm nouveau | grep Parameters -A 12
> Parameters:
> config = 28 6e 75 6c 6c 29 0a
> debug = "(null)"
> duallink = "1"
> hdmimhz = "0"
> ignorelid = "0"
> modeset = "-1"
> noaccel = "0"
> nofbaccel = "0"
> runpm = "-1"
> tv_disable = "0"
> tv_norm = "(null)"
> vram_pushbuf = "0"
>
> Signed-off-by: poma <pomidorabelisima at gmail.com>
>From Documentation/SubmittingPatches
"""
then you just add a line saying
Signed-off-by: Random J Developer <random at developer.example.org>
using your real name (sorry, no pseudonyms or anonymous contributions.)
"""
-ilia
More information about the Nouveau
mailing list