Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH] thermal: sysfs: fix whitespace and use octal permissions
@ 2026-05-11 16:37 Mayur Kumar
  2026-05-11 17:42 ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Mayur Kumar @ 2026-05-11 16:37 UTC (permalink / raw)
  To: rafael, daniel.lezcano, rui.zhang, lukasz.luba
  Cc: linux-pm, linux-kernel, Mayur Kumar

Clean up thermal_sysfs.c by removing a space before a tab and
replacing symbolic permissions (S_IRUGO, S_IWUSR) with their
preferred octal equivalents (0444, 0200) to improve readability.

Signed-off-by: Mayur Kumar <kmayur809@gmail.com>
---
 drivers/thermal/thermal_sysfs.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c
index 5eecae13f07..7cf6b0b060a 100644
--- a/drivers/thermal/thermal_sysfs.c
+++ b/drivers/thermal/thermal_sysfs.c
@@ -82,7 +82,7 @@ mode_store(struct device *dev, struct device_attribute *attr,
 }
 
 #define thermal_trip_of_attr(_ptr_, _attr_)				\
-	({ 								\
+	({\
 		struct thermal_trip_desc *td;				\
 									\
 		td = container_of(_ptr_, struct thermal_trip_desc,	\
@@ -405,7 +405,7 @@ static int create_trip_attrs(struct thermal_zone_device *tz)
 
 		sysfs_attr_init(&trip_attrs->type.attr.attr);
 		trip_attrs->type.attr.attr.name = trip_attrs->type.name;
-		trip_attrs->type.attr.attr.mode = S_IRUGO;
+		trip_attrs->type.attr.attr.mode = 0444;
 		trip_attrs->type.attr.show = trip_point_type_show;
 		attrs[i] = &trip_attrs->type.attr.attr;
 
@@ -415,10 +415,10 @@ static int create_trip_attrs(struct thermal_zone_device *tz)
 
 		sysfs_attr_init(&trip_attrs->temp.attr.attr);
 		trip_attrs->temp.attr.attr.name = trip_attrs->temp.name;
-		trip_attrs->temp.attr.attr.mode = S_IRUGO;
+		trip_attrs->temp.attr.attr.mode = 0444;
 		trip_attrs->temp.attr.show = trip_point_temp_show;
 		if (td->trip.flags & THERMAL_TRIP_FLAG_RW_TEMP) {
-			trip_attrs->temp.attr.attr.mode |= S_IWUSR;
+			trip_attrs->temp.attr.attr.mode |= 0200;
 			trip_attrs->temp.attr.store = trip_point_temp_store;
 		}
 		attrs[i + tz->num_trips] = &trip_attrs->temp.attr.attr;
@@ -428,10 +428,10 @@ static int create_trip_attrs(struct thermal_zone_device *tz)
 
 		sysfs_attr_init(&trip_attrs->hyst.attr.attr);
 		trip_attrs->hyst.attr.attr.name = trip_attrs->hyst.name;
-		trip_attrs->hyst.attr.attr.mode = S_IRUGO;
+		trip_attrs->hyst.attr.attr.mode = 0444;
 		trip_attrs->hyst.attr.show = trip_point_hyst_show;
 		if (td->trip.flags & THERMAL_TRIP_FLAG_RW_HYST) {
-			trip_attrs->hyst.attr.attr.mode |= S_IWUSR;
+			trip_attrs->hyst.attr.attr.mode |= 0200;
 			trip_attrs->hyst.attr.store = trip_point_hyst_store;
 		}
 		attrs[i + 2 * tz->num_trips] = &trip_attrs->hyst.attr.attr;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] thermal: sysfs: fix whitespace and use octal permissions
  2026-05-11 16:37 [PATCH] thermal: sysfs: fix whitespace and use octal permissions Mayur Kumar
@ 2026-05-11 17:42 ` Rafael J. Wysocki
  2026-05-11 17:52   ` [PATCH v2] thermal: sysfs: remove space before tab in macro Mayur Kumar
  0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2026-05-11 17:42 UTC (permalink / raw)
  To: Mayur Kumar
  Cc: rafael, daniel.lezcano, rui.zhang, lukasz.luba, linux-pm,
	linux-kernel

On Mon, May 11, 2026 at 6:37 PM Mayur Kumar <kmayur809@gmail.com> wrote:
>
> Clean up thermal_sysfs.c by removing a space before a tab

So please do the white space cleanup separately if you care enough.

The permissions are correct as they are AFAICS.

> and replacing symbolic permissions (S_IRUGO, S_IWUSR) with their
> preferred octal equivalents (0444, 0200) to improve readability.
>
> Signed-off-by: Mayur Kumar <kmayur809@gmail.com>
> ---
>  drivers/thermal/thermal_sysfs.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c
> index 5eecae13f07..7cf6b0b060a 100644
> --- a/drivers/thermal/thermal_sysfs.c
> +++ b/drivers/thermal/thermal_sysfs.c
> @@ -82,7 +82,7 @@ mode_store(struct device *dev, struct device_attribute *attr,
>  }
>
>  #define thermal_trip_of_attr(_ptr_, _attr_)                            \
> -       ({                                                              \
> +       ({\
>                 struct thermal_trip_desc *td;                           \
>                                                                         \
>                 td = container_of(_ptr_, struct thermal_trip_desc,      \
> @@ -405,7 +405,7 @@ static int create_trip_attrs(struct thermal_zone_device *tz)
>
>                 sysfs_attr_init(&trip_attrs->type.attr.attr);
>                 trip_attrs->type.attr.attr.name = trip_attrs->type.name;
> -               trip_attrs->type.attr.attr.mode = S_IRUGO;
> +               trip_attrs->type.attr.attr.mode = 0444;
>                 trip_attrs->type.attr.show = trip_point_type_show;
>                 attrs[i] = &trip_attrs->type.attr.attr;
>
> @@ -415,10 +415,10 @@ static int create_trip_attrs(struct thermal_zone_device *tz)
>
>                 sysfs_attr_init(&trip_attrs->temp.attr.attr);
>                 trip_attrs->temp.attr.attr.name = trip_attrs->temp.name;
> -               trip_attrs->temp.attr.attr.mode = S_IRUGO;
> +               trip_attrs->temp.attr.attr.mode = 0444;
>                 trip_attrs->temp.attr.show = trip_point_temp_show;
>                 if (td->trip.flags & THERMAL_TRIP_FLAG_RW_TEMP) {
> -                       trip_attrs->temp.attr.attr.mode |= S_IWUSR;
> +                       trip_attrs->temp.attr.attr.mode |= 0200;
>                         trip_attrs->temp.attr.store = trip_point_temp_store;
>                 }
>                 attrs[i + tz->num_trips] = &trip_attrs->temp.attr.attr;
> @@ -428,10 +428,10 @@ static int create_trip_attrs(struct thermal_zone_device *tz)
>
>                 sysfs_attr_init(&trip_attrs->hyst.attr.attr);
>                 trip_attrs->hyst.attr.attr.name = trip_attrs->hyst.name;
> -               trip_attrs->hyst.attr.attr.mode = S_IRUGO;
> +               trip_attrs->hyst.attr.attr.mode = 0444;
>                 trip_attrs->hyst.attr.show = trip_point_hyst_show;
>                 if (td->trip.flags & THERMAL_TRIP_FLAG_RW_HYST) {
> -                       trip_attrs->hyst.attr.attr.mode |= S_IWUSR;
> +                       trip_attrs->hyst.attr.attr.mode |= 0200;
>                         trip_attrs->hyst.attr.store = trip_point_hyst_store;
>                 }
>                 attrs[i + 2 * tz->num_trips] = &trip_attrs->hyst.attr.attr;
> --

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2] thermal: sysfs: remove space before tab in macro
  2026-05-11 17:42 ` Rafael J. Wysocki
@ 2026-05-11 17:52   ` Mayur Kumar
  0 siblings, 0 replies; 3+ messages in thread
From: Mayur Kumar @ 2026-05-11 17:52 UTC (permalink / raw)
  To: rafael, daniel.lezcano; +Cc: linux-pm, linux-kernel, Mayur Kumar

Signed-off-by: Mayur Kumar <kmayur809@gmail.com>
---
 drivers/thermal/thermal_sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c
index 5eecae13f07..15f269358e0 100644
--- a/drivers/thermal/thermal_sysfs.c
+++ b/drivers/thermal/thermal_sysfs.c
@@ -82,7 +82,7 @@ mode_store(struct device *dev, struct device_attribute *attr,
 }
 
 #define thermal_trip_of_attr(_ptr_, _attr_)				\
-	({ 								\
+	({\
 		struct thermal_trip_desc *td;				\
 									\
 		td = container_of(_ptr_, struct thermal_trip_desc,	\
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-05-11 17:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-11 16:37 [PATCH] thermal: sysfs: fix whitespace and use octal permissions Mayur Kumar
2026-05-11 17:42 ` Rafael J. Wysocki
2026-05-11 17:52   ` [PATCH v2] thermal: sysfs: remove space before tab in macro Mayur Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox