Skip to content

Commit 5fada16

Browse files
dramforeverPaul Walmsley
authored andcommitted
riscv: tests: Make RISCV_KPROBES_KUNIT tristate
This disallows KUNIT=m and RISCV_KPROBES_KUNIT=y, which produces these relocs_check.sh warnings when RELOCATABLE=y: WARNING: 3 bad relocations ffffffff81e24118 R_RISCV_64 kunit_unary_assert_format ffffffff81e24a60 R_RISCV_64 kunit_binary_assert_format ffffffff81e269d0 R_RISCV_JUMP_SLOT __kunit_do_failed_assertion This fixes allmodconfig build. Reported-by: Inochi Amaoto <inochiama@gmail.com> Fixes: f2fab61 ("riscv: Add kprobes KUnit test") Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn> Tested-by: Inochi Amaoto <inochiama@gmail.com> Reviewed-by: Nam Cao <namcao@linutronix.de> Link: https://lore.kernel.org/r/20251020-riscv-kunit-kconfig-fix-6-18-v1-2-d773b5d5ce48@iscas.ac.cn Signed-off-by: Paul Walmsley <pjw@kernel.org>
1 parent 2176603 commit 5fada16

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

arch/riscv/kernel/tests/Kconfig.debug

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ config RISCV_MODULE_LINKING_KUNIT
3131
If unsure, say N.
3232

3333
config RISCV_KPROBES_KUNIT
34-
bool "KUnit test for riscv kprobes" if !KUNIT_ALL_TESTS
34+
tristate "KUnit test for riscv kprobes" if !KUNIT_ALL_TESTS
3535
depends on KUNIT
3636
depends on KPROBES
3737
default KUNIT_ALL_TESTS
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
obj-y += test-kprobes.o test-kprobes-asm.o
1+
obj-$(CONFIG_RISCV_KPROBES_KUNIT) += kprobes_riscv_kunit.o
2+
3+
kprobes_riscv_kunit-objs := test-kprobes.o test-kprobes-asm.o

arch/riscv/kernel/tests/kprobes/test-kprobes.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,6 @@ static struct kunit_suite kprobes_test_suite = {
5454
};
5555

5656
kunit_test_suites(&kprobes_test_suite);
57+
58+
MODULE_LICENSE("GPL");
59+
MODULE_DESCRIPTION("KUnit test for riscv kprobes");

0 commit comments

Comments
 (0)