[PATCH 16/61] sched: Prefer IS_ERR_OR_NULL over manual NULL check

Philipp Hahn phahn-oss at avm.de
Tue Mar 10 04:48:42 PDT 2026


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

Change generated with coccinelle.

To: Tejun Heo <tj at kernel.org>
To: David Vernet <void at manifault.com>
To: Andrea Righi <arighi at nvidia.com>
To: Changwoo Min <changwoo at igalia.com>
To: Ingo Molnar <mingo at redhat.com>
To: Peter Zijlstra <peterz at infradead.org>
To: Juri Lelli <juri.lelli at redhat.com>
To: Vincent Guittot <vincent.guittot at linaro.org>
To: Dietmar Eggemann <dietmar.eggemann at arm.com>
To: Steven Rostedt <rostedt at goodmis.org>
To: Ben Segall <bsegall at google.com>
To: Mel Gorman <mgorman at suse.de>
To: Valentin Schneider <vschneid at redhat.com>
Cc: sched-ext at lists.linux.dev
Cc: linux-kernel at vger.kernel.org
Signed-off-by: Philipp Hahn <phahn-oss at avm.de>
---
 kernel/sched/ext.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index 1594987d637b09e586ae788b7f2e6336332d605a..cfa869bd7de5406a5ca094992ab04c62b0e92fd0 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -3688,7 +3688,7 @@ static void scx_sched_free_rcu_work(struct work_struct *work)
 	do {
 		rhashtable_walk_start(&rht_iter);
 
-		while ((dsq = rhashtable_walk_next(&rht_iter)) && !IS_ERR(dsq))
+		while (!IS_ERR_OR_NULL((dsq = rhashtable_walk_next(&rht_iter))))
 			destroy_dsq(sch, dsq->id);
 
 		rhashtable_walk_stop(&rht_iter);

-- 
2.43.0




More information about the Linux-rockchip mailing list