From: James Lee <james@codeconstruct.com.au>
To: Jeremy Kerr <jk@codeconstruct.com.au>,
Matt Johnston <matt@codeconstruct.com.au>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Geert Uytterhoeven <geert@linux-m68k.org>,
James Lee <james@codeconstruct.com.au>
Subject: [PATCH net] net: mctp: usblib: Fix broken assertion
Date: Mon, 26 Oct 2026 11:32:32 +0800 [thread overview]
Message-ID: <20261026-dev-mctp-static-assert-fix-v1-1-ceef9913e891@codeconstruct.com.au> (raw)
The expression in a static assertion in the kunit tests was not
considered constant by gcc, causing an error. Replace the static assert
with a runtime kunit equivalent.
Fixes: 1e12f734afc1 ("net: mctp: usblib: Add initial kunit tx tests")
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Closes: https://lore.kernel.org/netdev/CAMuHMdXTGGdGWZ9sKz5_sQF1237gV844cEhkXr6v_TUHPOb78Q@mail.gmail.com/
Signed-off-by: James Lee <james@codeconstruct.com.au>
---
drivers/net/mctp/mctp-usblib-test.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/mctp/mctp-usblib-test.c b/drivers/net/mctp/mctp-usblib-test.c
index b7e8743c561f948a9528fccfaa5a50cd78b3320e..3a48b10164b0975a9232a00800a8f7bf2f9c1cfa 100644
--- a/drivers/net/mctp/mctp-usblib-test.c
+++ b/drivers/net/mctp/mctp-usblib-test.c
@@ -816,8 +816,8 @@ static void mctp_usblib_test_tx_multi_push(struct kunit *test)
};
int rc;
- static_assert(!sends[ARRAY_SIZE(sends) - 1].more,
- "The last push must claim there will be no more");
+ KUNIT_ASSERT_TRUE_MSG(test, !sends[ARRAY_SIZE(sends) - 1].more,
+ "The last push must claim there will be no more");
max_length = 0;
for (i = 0; i < ARRAY_SIZE(sends); i++) {
---
base-commit: 734bef548a96e8774d6eef5dfa2026c6edc4e80b
change-id: 20261026-dev-mctp-static-assert-fix-d5d5b47ba2e2
Best regards,
--
James Lee <james@codeconstruct.com.au>
next reply other threads:[~2026-10-26 3:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-26 3:32 James Lee [this message]
2026-10-26 8:36 ` Geert Uytterhoeven
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=20261026-dev-mctp-static-assert-fix-v1-1-ceef9913e891@codeconstruct.com.au \
--to=james@codeconstruct.com.au \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=geert@linux-m68k.org \
--cc=jk@codeconstruct.com.au \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matt@codeconstruct.com.au \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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
all inboxes | Powered by JetHome®