Linux Kernel: Checkpatch Documentation Mentorship Tasks

Utkarsh Verma utkarshverma294 at gmail.com
Tue Aug 3 16:36:02 UTC 2021


On Mon, Jul 26, 2021 at 12:40:48PM +0200, Lukas Bulwahn wrote:
>
> On Sun, Jul 25, 2021 at 12:06 AM Utkarsh Verma
> <utkarshverma294 at gmail.com> wrote:
> >
> > On Sat, Jul 17, 2021 at 09:23:19AM +0200, Lukas Bulwahn wrote:
> > > Get a clone of the Linux kernel repository. The script checkpatch.pl
> > > is under the scripts directory.
> > >

(snip)

> >
> > drivers/usb/serial/iuu_phoenix.c:1191: WARNING: Symbolic permissions 'S_IRUGO | S_IWUSR' are not preferred. Consider using octal permissions '0644'.
> > drivers/usb/serial/iuu_phoenix.c:1194: WARNING: Symbolic permissions 'S_IRUGO | S_IWUSR' are not preferred. Consider using octal permissions '0644'.
> > drivers/usb/serial/iuu_phoenix.c:1197: WARNING: Symbolic permissions 'S_IRUGO | S_IWUSR' are not preferred. Consider using octal permissions '0644'.
> > drivers/usb/serial/iuu_phoenix.c:1201: WARNING: Symbolic permissions 'S_IRUGO | S_IWUSR' are not preferred. Consider using octal permissions '0644'.
> > drivers/usb/serial/iuu_phoenix.c:1205: WARNING: Symbolic permissions 'S_IRUGO | S_IWUSR' are not preferred. Consider using octal permissions '0644'.
> >
> > The file permission macros used in the kernel code are defined in
> > <linux/stat.h> like S_IRUGO and friends. But it is better to use their
> > octal equivalent instead, because it easier for Linux users to
> > understand 0444 instead of S_IRUGO.
> >
> > There is no checkpatch documentation for this warning message, but the
> > message is self explanatory.
> >
> 
> Please provide a patch for the checkpatch documentation here. Do you
> find a reference to some coding style guide in the kernel or some
> discussion on the mailing list that stated the preference you wrote
> here?
> 

Yes, Linus suggested the tree-wide conversions for using octal permission.
https://lwn.net/Articles/696229/

(snip)

> 
> Good luck; we are looking forward to your patch series.
> 
> Lukas


Regards,
Utkarsh Verma


More information about the Linux-kernel-mentees mailing list