thermal: sysfs: fix whitespace and use octal permissions
PATCH 1/1 thermal: sysfs: fix whitespace and use octal permissions
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.
--- drivers/thermal/thermal_sysfs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/thermal/thermal_sysfs.c +6 -6
@@ -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;
Signature · 1 line
2.34.1
Rafael J. Wysocki
maintainerQuoted 2 lines · Mayur Kumar
Clean up
thermal_sysfs.cby 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.
Quoted 57 lines
and replacing symbolic permissions (
S_IRUGO,S_IWUSR) with their preferred octal equivalents (0444, 0200) to improve readability.Signed-off-by Mayur Kumar <[email protected]>--- drivers/thermal/thermal_sysfs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)drivers/thermal/thermal_sysfs.c +6
-7@@ -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; --
PATCH v2 1/1 thermal: sysfs: remove space before tab in macro
--- drivers/thermal/thermal_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/thermal_sysfs.c +1 -1
@@ -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, \
Signature · 1 line
2.34.1
Re: [PATCH v2] thermal: sysfs: remove space before tab in macro
Quoted 11 lines · Mayur Kumar
Signed-off-by Mayur Kumar <[email protected]>--- drivers/thermal/thermal_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/thermal/thermal_sysfs.c +0
-0
drivers/thermal/thermal_sysfs.c mode_store(struct device *dev, struct device_attribute *attr, · line 85
Quoted 5 lines
drivers/thermal/thermal_sysfs.c +1
-1@@ -82,7 +82,7 @@ mode_store(struct device *dev, struct device_attribute *attr, }#define thermal_trip_of_attr (_ptr_, _attr_) \ - ({ \ + ({\
Broken, but I fixed it up.
drivers/thermal/thermal_sysfs.c mode_store(struct device *dev, struct device_attribute *attr,
Quoted 4 lines
drivers/thermal/thermal_sysfs.c +0
-1struct thermal_trip_desc *td; \ \ td = container_of(_ptr_, struct thermal_trip_desc, \ --
Applied as 7.2 material, thanks!