]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
leds: Prefer IS_ERR_OR_NULL over manual NULL check
authorPhilipp Hahn <phahn-oss@avm.de>
Tue, 10 Mar 2026 11:49:17 +0000 (12:49 +0100)
committerLee Jones <lee@kernel.org>
Tue, 10 Mar 2026 13:33:26 +0000 (13:33 +0000)
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>
Link: https://patch.msgid.link/20260310-b4-is_err_or_null-v1-51-bd63b656022d@avm.de
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/leds/trigger/ledtrig-tty.c

index 8eb6286b33ac3cdcbb72ed9ad5ad7105e15d20b6..3725571144d910b225ca9605771fc0f0c8355efd 100644 (file)
@@ -220,7 +220,7 @@ static void ledtrig_tty_work(struct work_struct *work)
                        goto out;
 
                tty = tty_kopen_shared(devno);
-               if (IS_ERR(tty) || !tty)
+               if (IS_ERR_OR_NULL(tty))
                        /* What to do? retry or abort */
                        goto out;