lkml.org 
[lkml]   [2022]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[RFC PATCH 4/4] kunit: delcare kunit_assert structs as const
From
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 --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, \
--
2.36.1.124.g0e6072fb45-goog
\
 
 \ /
  Last update: 2022-05-25 17:46    [W:0.052 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site