]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
leds: led-test: Remove standard error checking after KUNIT_ASSERT_*()
authorLee Jones <lee@kernel.org>
Thu, 1 May 2025 08:19:11 +0000 (09:19 +0100)
committerLee Jones <lee@kernel.org>
Wed, 14 May 2025 08:25:05 +0000 (09:25 +0100)
If a KUNIT_ASSERT_*() call ends up in an assertion, the test is marked
as a failure and the subsequent error checking is never executed, making
it superfluous.  Remove it for simplicity and to avoid confusion.

Link: https://lore.kernel.org/r/20250501081918.3621432-1-lee@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/leds/led-test.c

index 068c9d0eb6838803b2b9fa0e090819e19e910b00..23820189abe39d8aff99fdf0998e8bf36c1607f7 100644 (file)
@@ -26,8 +26,6 @@ static void led_test_class_register(struct kunit *test)
 
        ret = devm_led_classdev_register(dev, cdev);
        KUNIT_ASSERT_EQ(test, ret, 0);
-       if (ret)
-               return;
 }
 
 static struct kunit_case led_test_cases[] = {