diff mbox series

[RFC,4/4] kunit: delcare kunit_assert structs as const

Message ID 20220525154442.1438081-5-dlatypov@google.com (mailing list archive)
State Accepted
Commit c1144e01063e67f807517a393b91fae054929dc8
Delegated to: Brendan Higgins
Headers show
Series kunit: more assertion reworking | expand

Commit Message

Daniel Latypov May 25, 2022, 3:44 p.m. UTC
Everywhere we use the assert structs now takes them via const*, as of
https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/commit/?h=kunit&id=7466886b400b1904ce30fa311904849e314a2cf4

So now let's properly declare the structs as const as well.
---
 include/kunit/test.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/include/kunit/test.h b/include/kunit/test.h
index e4b54f5d2731..fa5955c8b412 100644
--- a/include/kunit/test.h
+++ b/include/kunit/test.h
@@ -514,7 +514,7 @@  void kunit_do_failed_assertion(struct kunit *test,
 
 #define _KUNIT_FAILED(test, assert_type, assert_class, assert_format, INITIALIZER, fmt, ...) do { \
 	static const struct kunit_loc __loc = KUNIT_CURRENT_LOC;	       \
-	struct assert_class __assertion = INITIALIZER;			       \
+	const struct assert_class __assertion = INITIALIZER;		       \
 	kunit_do_failed_assertion(test,					       \
 				  &__loc,				       \
 				  assert_type,				       \