Linux LED subsystem development
 help / color / mirror / Atom feed
* [PATCH 1/3] led: led-test: Remove standard error checking after KUNIT_ASSERT_*()
@ 2025-05-01  8:19 Lee Jones
  2025-05-01  8:19 ` [PATCH 2/3] leds: led-test: Fill out the registration test to cover more test cases Lee Jones
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Lee Jones @ 2025-05-01  8:19 UTC (permalink / raw)
  To: lee, Pavel Machek, linux-leds, linux-kernel
  Cc: bettyzhou, ynaffit, tkjos, jacek.anaszewski

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(-)

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-05-08 13:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-01  8:19 [PATCH 1/3] led: led-test: Remove standard error checking after KUNIT_ASSERT_*() Lee Jones
2025-05-01  8:19 ` [PATCH 2/3] leds: led-test: Fill out the registration test to cover more test cases Lee Jones
2025-05-01  8:19 ` [PATCH 3/3] leds: led-test: Provide tests for the lookup and get infrastructure Lee Jones
2025-05-08 13:53 ` [PATCH 1/3] led: led-test: Remove standard error checking after KUNIT_ASSERT_*() Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox