* [PATCH] thermal: sysfs: Fix indentation in create_s32_tzp_attr()
@ 2026-10-03 0:00 Thorsten Blum
2026-10-26 19:26 ` Rafael J. Wysocki (Intel)
0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2026-10-03 0:00 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba
Cc: Thorsten Blum, linux-pm, linux-kernel
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 <blum@kernel.org>
---
drivers/thermal/thermal_sysfs.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c
index 96fe5d591a0a..47daba943a76 100644
--- a/drivers/thermal/thermal_sysfs.c
+++ b/drivers/thermal/thermal_sysfs.c
@@ -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 \
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] thermal: sysfs: Fix indentation in create_s32_tzp_attr()
2026-10-03 0:00 [PATCH] thermal: sysfs: Fix indentation in create_s32_tzp_attr() Thorsten Blum
@ 2026-10-26 19:26 ` Rafael J. Wysocki (Intel)
0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki (Intel) @ 2026-10-26 19:26 UTC (permalink / raw)
To: Thorsten Blum
Cc: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
linux-pm, linux-kernel
On Sat, Oct 3, 2026 at 2:01 AM Thorsten Blum <blum@kernel.org> wrote:
>
> 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 <blum@kernel.org>
> ---
> drivers/thermal/thermal_sysfs.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c
> index 96fe5d591a0a..47daba943a76 100644
> --- a/drivers/thermal/thermal_sysfs.c
> +++ b/drivers/thermal/thermal_sysfs.c
> @@ -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 \
Applied as 7.4-rc material, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-26 19:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-03 0:00 [PATCH] thermal: sysfs: Fix indentation in create_s32_tzp_attr() Thorsten Blum
2026-10-26 19:26 ` Rafael J. Wysocki (Intel)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox