Skip to content

Commit 988f454

Browse files
computersforpeaceKAGA-KOKO
authored andcommitted
genirq/test: Fail early if interrupt request fails
Requesting an interrupt is part of the basic test setup. If it fails, most of the subsequent tests are likely to fail, and the output gets noisy. Use "assert" to fail early. Signed-off-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: David Gow <davidgow@google.com> Link: https://lore.kernel.org/all/20250822190140.2154646-4-briannorris@chromium.org
1 parent 59405c2 commit 988f454

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

kernel/irq/irq_test.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static void irq_disable_depth_test(struct kunit *test)
7171
KUNIT_ASSERT_PTR_NE(test, desc, NULL);
7272

7373
ret = request_irq(virq, noop_handler, 0, "test_irq", NULL);
74-
KUNIT_EXPECT_EQ(test, ret, 0);
74+
KUNIT_ASSERT_EQ(test, ret, 0);
7575

7676
KUNIT_EXPECT_EQ(test, desc->depth, 0);
7777

@@ -95,7 +95,7 @@ static void irq_free_disabled_test(struct kunit *test)
9595
KUNIT_ASSERT_PTR_NE(test, desc, NULL);
9696

9797
ret = request_irq(virq, noop_handler, 0, "test_irq", NULL);
98-
KUNIT_EXPECT_EQ(test, ret, 0);
98+
KUNIT_ASSERT_EQ(test, ret, 0);
9999

100100
KUNIT_EXPECT_EQ(test, desc->depth, 0);
101101

@@ -106,7 +106,7 @@ static void irq_free_disabled_test(struct kunit *test)
106106
KUNIT_EXPECT_GE(test, desc->depth, 1);
107107

108108
ret = request_irq(virq, noop_handler, 0, "test_irq", NULL);
109-
KUNIT_EXPECT_EQ(test, ret, 0);
109+
KUNIT_ASSERT_EQ(test, ret, 0);
110110
KUNIT_EXPECT_EQ(test, desc->depth, 0);
111111

112112
free_irq(virq, NULL);
@@ -134,7 +134,7 @@ static void irq_shutdown_depth_test(struct kunit *test)
134134
KUNIT_ASSERT_PTR_NE(test, data, NULL);
135135

136136
ret = request_irq(virq, noop_handler, 0, "test_irq", NULL);
137-
KUNIT_EXPECT_EQ(test, ret, 0);
137+
KUNIT_ASSERT_EQ(test, ret, 0);
138138

139139
KUNIT_EXPECT_TRUE(test, irqd_is_activated(data));
140140
KUNIT_EXPECT_TRUE(test, irqd_is_started(data));
@@ -191,7 +191,7 @@ static void irq_cpuhotplug_test(struct kunit *test)
191191
KUNIT_ASSERT_PTR_NE(test, data, NULL);
192192

193193
ret = request_irq(virq, noop_handler, 0, "test_irq", NULL);
194-
KUNIT_EXPECT_EQ(test, ret, 0);
194+
KUNIT_ASSERT_EQ(test, ret, 0);
195195

196196
KUNIT_EXPECT_TRUE(test, irqd_is_activated(data));
197197
KUNIT_EXPECT_TRUE(test, irqd_is_started(data));

0 commit comments

Comments
 (0)