Skip to contentSkip to conversation

pinctrl: use to octal permissions for debugfs files

PATCH In review Drew Fustini 2 participants 4 messages Jan 27, 2021 – Feb 17, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pinctrl: use to octal permissions for debugfs files

Switch over pinctrl debugfs files to use octal permissions as they are preferred over symbolic permissions. Refer to commit f90774e1fd27 ("checkpatch: look for symbolic permissions and suggest octal instead").

---
Patch note:
- I learned about this preference of octal over symbolic when I created an RFC to add a new debugfs file ("pinmux-select"). I am submitting this patch to switch existing entries in pinctrl over to octal before I submit a proper PATCH for the "pinmux-select" functionality in which I will use octal permissions for the new file.

 drivers/pinctrl/core.c    | 6 +++---
 drivers/pinctrl/pinconf.c | 4 ++--
 drivers/pinctrl/pinmux.c  | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)
drivers/pinctrl/core.c +3 -3
index 9fc4433fece4..791736b2de77 100644
@@ -1916,11 +1916,11 @@ static void pinctrl_init_debugfs(void)
 		return;
 	}
 
-	debugfs_create_file("pinctrl-devices", S_IFREG | S_IRUGO,
+	debugfs_create_file("pinctrl-devices", 0400,
 			    debugfs_root, NULL, &pinctrl_devices_fops);
-	debugfs_create_file("pinctrl-maps", S_IFREG | S_IRUGO,
+	debugfs_create_file("pinctrl-maps", 0400,
 			    debugfs_root, NULL, &pinctrl_maps_fops);
-	debugfs_create_file("pinctrl-handles", S_IFREG | S_IRUGO,
+	debugfs_create_file("pinctrl-handles", 0400,
 			    debugfs_root, NULL, &pinctrl_fops);
 }
 
drivers/pinctrl/pinconf.c +2 -2
index 02c075cc010b..f005921bb49e 100644
@@ -370,9 +370,9 @@ DEFINE_SHOW_ATTRIBUTE(pinconf_groups);
 void pinconf_init_device_debugfs(struct dentry *devroot,
 			 struct pinctrl_dev *pctldev)
 {
-	debugfs_create_file("pinconf-pins", S_IFREG | S_IRUGO,
+	debugfs_create_file("pinconf-pins", 0400,
 			    devroot, pctldev, &pinconf_pins_fops);
-	debugfs_create_file("pinconf-groups", S_IFREG | S_IRUGO,
+	debugfs_create_file("pinconf-groups", 0400,
 			    devroot, pctldev, &pinconf_groups_fops);
 }
 
drivers/pinctrl/pinmux.c +2 -2
index bab888fe3f8e..7f6190eaedbb 100644
@@ -676,9 +676,9 @@ DEFINE_SHOW_ATTRIBUTE(pinmux_pins);
 void pinmux_init_device_debugfs(struct dentry *devroot,
 			 struct pinctrl_dev *pctldev)
 {
-	debugfs_create_file("pinmux-functions", S_IFREG | S_IRUGO,
+	debugfs_create_file("pinmux-functions", 0400,
 			    devroot, pctldev, &pinmux_functions_fops);
-	debugfs_create_file("pinmux-pins", S_IFREG | S_IRUGO,
+	debugfs_create_file("pinmux-pins", 0400,
 			    devroot, pctldev, &pinmux_pins_fops);
 }
 
Signature · 1 line
2.25.1
#1 lore raw
Quoted 5 lines · Drew Fustini

Switch over pinctrl debugfs files to use octal permissions as they are preferred over symbolic permissions. Refer to commit f90774e1fd27 ("checkpatch: look for symbolic permissions and suggest octal instead").

That's right. Patch applied!

Yours,
Linus Walleij

#2 lore raw
Quoted 6 lines · Linus Walleij
Quoted 4 lines · Drew Fustini

Switch over pinctrl debugfs files to use octal permissions as they are preferred over symbolic permissions. Refer to commit f90774e1fd27 ("checkpatch: look for symbolic permissions and suggest octal instead").

Quoted 6 lines
Quoted 1 line

That's right. Patch applied!

Yours,
Linus Walleij

Thanks, Linus. However, Andy suggested I make this a series as it was prep for my patch to add 'pinmux-select' to debugfs. I posted it as part of a 2 patch series [1]. In addition, Joe Perches noticed I forgot 3 instances of debugfs_create_file() in core.c so I was about to fix that in v5 of the patch series. v5 is mostly addressing comments on the pinmux-select feature.

Thank you,
Drew

[1] https://lore.kernel.org/linux-gpio/[email protected]/

#3 lore raw
Quoted 14 lines · Drew Fustini
Quoted 6 lines · Linus Walleij
Quoted 4 lines · Drew Fustini

Switch over pinctrl debugfs files to use octal permissions as they are preferred over symbolic permissions. Refer to commit f90774e1fd27 ("checkpatch: look for symbolic permissions and suggest octal instead").

Quoted 6 lines
Quoted 1 line

That's right. Patch applied!

Yours,
Linus Walleij

Quoted 6 lines

Thanks, Linus. However, Andy suggested I make this a series as it was prep for my patch to add 'pinmux-select' to debugfs. I posted it as part of a 2 patch series [1]. In addition, Joe Perches noticed I forgot 3 instances of debugfs_create_file() in core.c so I was about to fix that in v5 of the patch series. v5 is mostly addressing comments on the pinmux-select feature.

Oh I saw that and pulled it out again, no big deal.

Yours,
Linus Walleij