net: mctp: usblib: Fix broken assertion
PATCH 1/1 net: mctp: usblib: Fix broken assertion
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.
--- drivers/net/mctp/mctp-usblib-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/mctp/mctp-usblib-test.c +2 -2
@@ -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,
Signature · 1 line
James Lee <[email protected]>
Quoted 8 lines · James Lee
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 <[email protected]>Closes https://lore.kernel.org/netdev/CAMuHMdXTGGdGWZ9sKz5_sQF1237gV844cEhkXr6v_TUHPOb78Q@mail.gmail.com/ open hereSigned-off-by James Lee <[email protected]>
Thanks, this fixes the build for me.
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 10 lines · On Mon, 26 Oct 2026 11:32:32 +0800 you wrote:
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 <[email protected]>Closes https://lore.kernel.org/netdev/CAMuHMdXTGGdGWZ9sKz5_sQF1237gV844cEhkXr6v_TUHPOb78Q@mail.gmail.com/ open hereSigned-off-by James Lee <[email protected]>[...]
Here is the summary with links:
- [net] net: mctp: usblib: Fix broken assertion
https://git.kernel.org/netdev/net/c/8146be04908d
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html