Message ID | 20250501081918.3621432-1-lee@kernel.org |
---|---|
State | New |
Headers | show |
Series | [1/3] led: led-test: Remove standard error checking after KUNIT_ASSERT_*() | expand |
On Thu, 01 May 2025 09:19:11 +0100, Lee Jones wrote: > 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. > > Applied, thanks! [1/3] led: led-test: Remove standard error checking after KUNIT_ASSERT_*() commit: ea82d1979ca379b64adf6ee4ca09c2e3f96298e4 [2/3] leds: led-test: Fill out the registration test to cover more test cases commit: 025415faccf52ce96dacc462a5bdaebae30079ac [3/3] leds: led-test: Provide tests for the lookup and get infrastructure commit: 2de105202e025c7b8c7c36792363879a773bdb96 -- Lee Jones [李琼斯]
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[] = {
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@kernel.org> --- drivers/leds/led-test.c | 2 -- 1 file changed, 2 deletions(-)