Skip to content

Commit

Permalink
kunit: declare kunit_assert structs as const
Browse files Browse the repository at this point in the history
Everywhere we use the assert structs now takes them via const*, as of
commit 7466886 ("kunit: take `kunit_assert` as `const`").

So now let's properly declare the structs as const as well.

Signed-off-by: Daniel Latypov <dlatypov@google.com>
Reviewed-by: David Gow <davidgow@google.com>
Reviewed-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
  • Loading branch information
Daniel Latypov authored and Shuah Khan committed Oct 7, 2022
1 parent 97d453b commit c1144e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/kunit/test.h
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,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, \
Expand Down

0 comments on commit c1144e0

Please sign in to comment.