]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
kunit: declare kunit_assert structs as const
authorDaniel Latypov <dlatypov@google.com>
Sat, 1 Oct 2022 00:26:38 +0000 (17:26 -0700)
committerShuah Khan <skhan@linuxfoundation.org>
Fri, 7 Oct 2022 16:19:18 +0000 (10:19 -0600)
Everywhere we use the assert structs now takes them via const*, as of
commit 7466886b400b ("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>
include/kunit/test.h

index 38a1aac72fb282a8bdcc93080ad054b111a9f444..b1ab6b32216d79cb4c14bf948a6bfd9e8782a5c9 100644 (file)
@@ -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,                                 \