All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: mctp: usblib: Fix broken assertion
@ 2026-10-26  3:32 James Lee
  2026-10-26  8:36 ` Geert Uytterhoeven
  2026-10-29  0:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: James Lee @ 2026-10-26  3:32 UTC (permalink / raw)
  To: Jeremy Kerr, Matt Johnston, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: netdev, linux-kernel, Geert Uytterhoeven, 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 <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>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: mctp: usblib: Fix broken assertion
  2026-10-26  3:32 [PATCH net] net: mctp: usblib: Fix broken assertion James Lee
@ 2026-10-26  8:36 ` Geert Uytterhoeven
  2026-10-29  0:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2026-10-26  8:36 UTC (permalink / raw)
  To: James Lee
  Cc: Jeremy Kerr, Matt Johnston, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, netdev, linux-kernel

On Mon, 26 Oct 2026 at 04:33, James Lee <james@codeconstruct.com.au> 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 <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>

Thanks, this fixes the build for me.
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: mctp: usblib: Fix broken assertion
  2026-10-26  3:32 [PATCH net] net: mctp: usblib: Fix broken assertion James Lee
  2026-10-26  8:36 ` Geert Uytterhoeven
@ 2026-10-29  0:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-10-29  0:30 UTC (permalink / raw)
  To: James Lee
  Cc: jk, matt, andrew+netdev, davem, edumazet, kuba, pabeni, netdev,
	linux-kernel, geert

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

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 <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>
> 
> [...]

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-29  0:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-26  3:32 [PATCH net] net: mctp: usblib: Fix broken assertion James Lee
2026-10-26  8:36 ` Geert Uytterhoeven
2026-10-29  0:30 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.