Thread (124 messages) 124 messages, 35 authors, 2026-04-16

[PATCH 45/61] thermal: Prefer IS_ERR_OR_NULL over manual NULL check

From: Philipp Hahn <hidden>
Date: 2026-03-10 11:55:52
Also in: amd-gfx, bpf, ceph-devel, dm-devel, dri-devel, gfs2, intel-wired-lan, kvm, linux-block, linux-bluetooth, linux-btrfs, linux-cifs, linux-clk, linux-ext4, linux-fsdevel, linux-gpio, linux-hyperv, linux-input, linux-iommu, linux-leds, linux-media, linux-mips, linux-mm, linux-modules, linux-nfs, linux-omap, linux-phy, linux-pm, linux-rockchip, linux-s390, linux-scsi, linux-sctp, linux-security-module, linux-sh, linux-sound, linux-trace-kernel, linux-usb, linux-wireless, lkml, ntfs3, sched-ext, target-devel, v9fs
Subsystem: the rest, thermal, ti bandgap and thermal driver · Maintainers: Linus Torvalds, Rafael J. Wysocki, Daniel Lezcano, Eduardo Valentin, Keerthy

Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL
check.

Change generated with coccinelle.

To: Eduardo Valentin <edubezval@gmail.com>
To: Keerthy <j-keerthy@ti.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
To: Daniel Lezcano <daniel.lezcano@kernel.org>
To: Zhang Rui <rui.zhang@intel.com>
To: Lukasz Luba <lukasz.luba@arm.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-omap@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Philipp Hahn <redacted>
---
 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 0cf0826b805a998abd0d4e2cfa6938de8a46c4f0..9218417e6d923ec370e032f5b91f9a839fd293f4 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.43.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help