From: "Björn Töpel" <bjorn@kernel.org>
To: Palmer Dabbelt <palmer@dabbelt.com>,
Andy Shevchenko <andy@kernel.org>,
linux-kernel@vger.kernel.org
Cc: "Björn Töpel" <bjorn@rivosinc.com>,
"Heiko Stuebner" <heiko@sntech.de>,
linux-riscv@lists.infradead.org
Subject: [PATCH v2 1/2] lib/test_string.c: Make definition less dense
Date: Tue, 28 Feb 2023 19:42:44 +0100 [thread overview]
Message-ID: <20230228184245.1585775-1-bjorn@kernel.org> (raw)
From: Björn Töpel <bjorn@rivosinc.com>
Checkpatch seems to have trouble making sense of the situation when
struct definitions, variable definitions, and __initconst marking is
done in one go.
Let's be nicer to checkpatch, and move the struct definition out,
which removes the error.
Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
---
lib/test_string.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/lib/test_string.c b/lib/test_string.c
index c5cb92fb710e..550229084c41 100644
--- a/lib/test_string.c
+++ b/lib/test_string.c
@@ -179,15 +179,17 @@ static __init int strnchr_selftest(void)
return 0;
}
+struct strspn_test {
+ const char str[16];
+ const char accept[16];
+ const char reject[16];
+ unsigned int a;
+ unsigned int r;
+};
+
static __init int strspn_selftest(void)
{
- static const struct strspn_test {
- const char str[16];
- const char accept[16];
- const char reject[16];
- unsigned a;
- unsigned r;
- } tests[] __initconst = {
+ static const struct strspn_test tests[] __initconst = {
{ "foobar", "", "", 0, 6 },
{ "abba", "abc", "ABBA", 4, 4 },
{ "abba", "a", "b", 1, 1 },
base-commit: ae3419fbac845b4d3f3a9fae4cc80c68d82cdf6e
--
2.37.2
next reply other threads:[~2023-02-28 18:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-28 18:42 Björn Töpel [this message]
2023-02-28 18:42 ` [PATCH v2 2/2] lib/test_string.c: Add strncmp() tests Björn Töpel
2023-02-28 19:03 ` [PATCH v2 1/2] lib/test_string.c: Make definition less dense Andy Shevchenko
2023-02-28 19:41 ` Björn Töpel
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=20230228184245.1585775-1-bjorn@kernel.org \
--to=bjorn@kernel.org \
--cc=andy@kernel.org \
--cc=bjorn@rivosinc.com \
--cc=heiko@sntech.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
/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