thermal: sysfs: Fix indentation in create_s32_tzp_attr()
PATCH 1/1 thermal: sysfs: Fix indentation in create_s32_tzp_attr()
Indent the show callback consistently with the store callback and use an early return if the thermal zone parameters are not available.
Signed-off-by Thorsten Blum <[email protected]>
--- drivers/thermal/thermal_sysfs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/thermal/thermal_sysfs.c +4 -4
@@ -287,12 +287,12 @@ sustainable_power_store(struct device *dev, struct device_attribute *devattr, name##_show(struct device *dev, struct device_attribute *devattr, \char *buf) \ { \ -struct thermal_zone_device *tz =to_thermal_zone (dev); \ +struct thermal_zone_device *tz =to_thermal_zone (dev); \ + \ +if (!tz->tzp) \ +return -EIO ; \ \ -if (tz->tzp) \return sysfs_emit (buf,"%d\n" , tz->tzp->name); \ -else \ -return -EIO ; \ } \ \ static ssize_t \
Quoted 20 lines · Thorsten Blum
Indent the show callback consistently with the store callback and use an early return if the thermal zone parameters are not available.
Signed-off-by Thorsten Blum <[email protected]>--- drivers/thermal/thermal_sysfs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/thermal/thermal_sysfs.c +2
-1@@ -287,12 +287,12 @@ sustainable_power_store(struct device *dev, struct device_attribute *devattr, name##_show(struct device *dev, struct device_attribute *devattr, \char *buf) \ { \ -struct thermal_zone_device *tz =to_thermal_zone (dev); \ +struct thermal_zone_device *tz =to_thermal_zone (dev); \ + \
drivers/thermal/thermal_sysfs.c sustainable_power_store(struct device *dev, struct device_attribute *devattr, · line 298
Quoted 10 lines
drivers/thermal/thermal_sysfs.c +2
-3+if (!tz->tzp) \ +return -EIO ; \ \ -if (tz->tzp) \return sysfs_emit (buf,"%d\n" , tz->tzp->name); \ -else \ -return -EIO ; \ } \ \ static ssize_t \
Applied as 7.4-rc material, thanks!