Re: [PATCH 2/2 v2] char: misc: use octal permissions for the proc entry

From: Martin Kaiser
Date: Tue Apr 18 2017 - 05:13:30 EST


Thus wrote Greg Kroah-Hartman (gregkh@xxxxxxxxxxxxxxxxxxx):

> > ERROR: Use 4 digit octal (0777) not decimal permissions
> > #285: FILE: drivers/char/misc.c:285:
> > + ret = proc_create("misc", 0, NULL, &misc_proc_fops);

> Come on now, think about what this is saying. Is 0 not also an octal
> number?

checkpatch is asking for a 4 digit octal number. And at least for me,
0444 makes it clearer what the permissions actually are. Yes, somewhere
in the code, I can dig up that 0 is changed to 0444...

> checkpatch requires you to use your brain, it is but a dumb perl
> script...

Sorry, I won't be arguing on a personal level.
If you don't like the patch, feel free to reject it. No problem for me.

Do you think checkpatch shouldn't be looking for exactly 4 digits here
(and elsewhere, it has a list of functions with a permission parameter)?

Best regards,

Martin