From 7466886b400b1904ce30fa311904849e314a2cf4 Mon Sep 17 00:00:00 2001 From: Miguel Ojeda Date: Mon, 2 May 2022 11:36:25 +0200 Subject: kunit: take `kunit_assert` as `const` The `kunit_do_failed_assertion` function passes its `struct kunit_assert` argument to `kunit_fail`. This one, in turn, calls its `format` field passing the assert again as a `const` pointer. Therefore, the whole chain may be made `const`. Signed-off-by: Miguel Ojeda Reviewed-by: Daniel Latypov Reviewed-by: Kees Cook Signed-off-by: Shuah Khan --- include/kunit/test.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/kunit') diff --git a/include/kunit/test.h b/include/kunit/test.h index 607e02b8e167..8ffcd7de9607 100644 --- a/include/kunit/test.h +++ b/include/kunit/test.h @@ -508,7 +508,7 @@ void __printf(2, 3) kunit_log_append(char *log, const char *fmt, ...); void kunit_do_failed_assertion(struct kunit *test, const struct kunit_loc *loc, enum kunit_assert_type type, - struct kunit_assert *assert, + const struct kunit_assert *assert, const char *fmt, ...); #define KUNIT_ASSERTION(test, assert_type, pass, assert_class, INITIALIZER, fmt, ...) do { \ -- cgit v1.2.3