diff mbox series

[v2,1/2] pinctrl: use to octal permissions for debugfs files

Message ID 20210210074946.155417-2-drew@beagleboard.org
State New
Headers show
Series pinctrl: pinmux: Add pinmux-select debugfs file | expand

Commit Message

Drew Fustini Feb. 10, 2021, 7:49 a.m. UTC
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").

Signed-off-by: Drew Fustini <drew@beagleboard.org>
---
 drivers/pinctrl/core.c    | 6 +++---
 drivers/pinctrl/pinconf.c | 4 ++--
 drivers/pinctrl/pinmux.c  | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

Comments

Geert Uytterhoeven Feb. 10, 2021, 8:31 a.m. UTC | #1
Hi Drew,

On Wed, Feb 10, 2021 at 8:50 AM Drew Fustini <drew@beagleboard.org> wrote:
> 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").
>
> Signed-off-by: Drew Fustini <drew@beagleboard.org>

Thanks for your patch!

> --- a/drivers/pinctrl/core.c
> +++ b/drivers/pinctrl/core.c
> @@ -1914,11 +1914,11 @@ static void pinctrl_init_debugfs(void)
>                 return;
>         }
>
> -       debugfs_create_file("pinctrl-devices", S_IFREG | S_IRUGO,
> +       debugfs_create_file("pinctrl-devices", 0400,

What about the loss of S_IFREG?
S_IRUGO = 0444, not 0400.

Gr{oetje,eeting}s,

                        Geert
Andy Shevchenko Feb. 10, 2021, 10:16 a.m. UTC | #2
On Wed, Feb 10, 2021 at 9:50 AM Drew Fustini <drew@beagleboard.org> wrote:
>
> 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").

You forgot:
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>

LGTM after addressing what Geert noticed.

> Signed-off-by: Drew Fustini <drew@beagleboard.org>
> ---
>  drivers/pinctrl/core.c    | 6 +++---
>  drivers/pinctrl/pinconf.c | 4 ++--
>  drivers/pinctrl/pinmux.c  | 4 ++--
>  3 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
> index 3663d87f51a0..c9c28f653799 100644
> --- a/drivers/pinctrl/core.c
> +++ b/drivers/pinctrl/core.c
> @@ -1914,11 +1914,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);
>  }
>
> diff --git a/drivers/pinctrl/pinconf.c b/drivers/pinctrl/pinconf.c
> index 02c075cc010b..f005921bb49e 100644
> --- a/drivers/pinctrl/pinconf.c
> +++ b/drivers/pinctrl/pinconf.c
> @@ -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);
>  }
>
> diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c
> index bab888fe3f8e..7f6190eaedbb 100644
> --- a/drivers/pinctrl/pinmux.c
> +++ b/drivers/pinctrl/pinmux.c
> @@ -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);
>  }
>
> --
> 2.25.1
>


--
With Best Regards,
Andy Shevchenko
diff mbox series

Patch

diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index 3663d87f51a0..c9c28f653799 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -1914,11 +1914,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);
 }
 
diff --git a/drivers/pinctrl/pinconf.c b/drivers/pinctrl/pinconf.c
index 02c075cc010b..f005921bb49e 100644
--- a/drivers/pinctrl/pinconf.c
+++ b/drivers/pinctrl/pinconf.c
@@ -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);
 }
 
diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c
index bab888fe3f8e..7f6190eaedbb 100644
--- a/drivers/pinctrl/pinmux.c
+++ b/drivers/pinctrl/pinmux.c
@@ -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);
 }