Re: Linux Kernel: Checkpatch Documentation Mentorship Tasks
From: Utkarsh Verma <hidden>
Date: 2021-08-03 16:36:19
On Mon, Jul 26, 2021 at 12:40:48PM +0200, Lukas Bulwahn wrote:
On Sun, Jul 25, 2021 at 12:06 AM Utkarsh Verma [off-list ref] wrote:quoted
On Sat, Jul 17, 2021 at 09:23:19AM +0200, Lukas Bulwahn wrote:quoted
Get a clone of the Linux kernel repository. The script checkpatch.pl is under the scripts directory.
(snip)
quoted
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 _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees