]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
sched: Prefer IS_ERR_OR_NULL over manual NULL check
authorPhilipp Hahn <phahn-oss@avm.de>
Tue, 10 Mar 2026 11:48:42 +0000 (12:48 +0100)
committerTejun Heo <tj@kernel.org>
Tue, 10 Mar 2026 16:58:37 +0000 (06:58 -1000)
Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL
check.

Change generated with coccinelle.

Signed-off-by: Philipp Hahn <phahn-oss@avm.de>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/sched/ext.c

index 07476355bfd52d6eebb872e1ef1f24fabd37ef1d..93a230859dd7cc7b66a4400aee8fc4ddbe5c6254 100644 (file)
@@ -4529,7 +4529,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);