linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Latypov <dlatypov@google.com>
To: brendanhiggins@google.com, davidgow@google.com
Cc: linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com,
	linux-kselftest@vger.kernel.org, skhan@linuxfoundation.org,
	miguel.ojeda.sandonis@gmail.com,
	Daniel Latypov <dlatypov@google.com>
Subject: [PATCH 4/4] kunit: declare kunit_assert structs as const
Date: Fri, 30 Sep 2022 17:26:38 -0700	[thread overview]
Message-ID: <20221001002638.2881842-5-dlatypov@google.com> (raw)
In-Reply-To: <20221001002638.2881842-1-dlatypov@google.com>

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>
---
 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 e49348bbc6ee..d574c871dd9f 100644
--- a/include/kunit/test.h
+++ b/include/kunit/test.h
@@ -477,7 +477,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.38.0.rc1.362.ged0d419d3c-goog


  parent reply	other threads:[~2022-10-01  0:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-01  0:26 [PATCH 0/4] kunit: more assertion reworking Daniel Latypov
2022-10-01  0:26 ` [PATCH 1/4] kunit: remove format func from struct kunit_assert, get it to 0 bytes Daniel Latypov
2022-10-01  3:26   ` David Gow
2022-10-01  0:26 ` [PATCH 2/4] kunit: rename base KUNIT_ASSERTION macro to _KUNIT_FAILED Daniel Latypov
2022-10-01  3:26   ` David Gow
2022-10-01  3:50     ` Daniel Latypov
2022-10-01  4:13       ` David Gow
2022-10-01  0:26 ` [PATCH 3/4] kunit: eliminate KUNIT_INIT_*_ASSERT_STRUCT macros Daniel Latypov
2022-10-01  3:26   ` David Gow
2022-10-01 10:12   ` Miguel Ojeda
2022-10-01 17:48     ` Daniel Latypov
2022-10-01  0:26 ` Daniel Latypov [this message]
2022-10-01  3:26   ` [PATCH 4/4] kunit: declare kunit_assert structs as const David Gow
2022-10-01 10:06   ` Miguel Ojeda
2022-10-01 10:15 ` [PATCH 0/4] kunit: more assertion reworking Miguel Ojeda
2022-10-01 18:00   ` Daniel Latypov
2022-10-18 23:20     ` Miguel Ojeda
2022-10-18 23:26       ` Daniel Latypov
2022-10-18 23:39         ` Miguel Ojeda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221001002638.2881842-5-dlatypov@google.com \
    --to=dlatypov@google.com \
    --cc=brendanhiggins@google.com \
    --cc=davidgow@google.com \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).