* [PATCH] thermal/drivers/ti-soc: Use IS_ERR_OR_NULL() to simplify code
@ 2025-08-14 12:26 Liao Yuanhong
0 siblings, 0 replies; only message in thread
From: Liao Yuanhong @ 2025-08-14 12:26 UTC (permalink / raw)
To: Eduardo Valentin, Keerthy, Rafael J. Wysocki, Daniel Lezcano,
Zhang Rui, Lukasz Luba, open list:TI BANDGAP AND THERMAL DRIVER,
open list:TI BANDGAP AND THERMAL DRIVER, open list
Cc: Liao Yuanhong
Use IS_ERR_OR_NULL() instead of the original !xxx || IS_ERR(xxx) logic.
This will simplify the code and enhance readability.
Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
---
drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
index 0cf0826b805a..9218417e6d92 100644
--- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
+++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
@@ -228,7 +228,7 @@ int ti_thermal_register_cpu_cooling(struct ti_bandgap *bgp, int id)
return 0;
data = ti_bandgap_get_sensor_data(bgp, id);
- if (!data || IS_ERR(data))
+ if (IS_ERR_OR_NULL(data))
data = ti_thermal_build_data(bgp, id);
if (!data)
--
2.34.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-08-14 12:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-14 12:26 [PATCH] thermal/drivers/ti-soc: Use IS_ERR_OR_NULL() to simplify code Liao Yuanhong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).