[PATCH 1/3] led: led-test: Remove standard error checking after KUNIT_ASSERT_*()
From: Lee Jones
Date: Thu May 01 2025 - 04:19:37 EST
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.
Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
---
drivers/leds/led-test.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/leds/led-test.c b/drivers/leds/led-test.c
index 068c9d0eb683..23820189abe3 100644
--- a/drivers/leds/led-test.c
+++ b/drivers/leds/led-test.c
@@ -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[] = {
--
2.49.0.906.g1f30a19c02-goog