Re: [PATCH net-next] net: airoha: fix ARRAY_SIZE() division by zero on UP builds

[email protected]
Newsgroups dev.linux.lists.llvm,org.infradead.lists.linux-arm-kernel,org.infradead.lists.linux-mediatek,org.kernel.vger.netdev
Message-ID <178589160888.3856351.13210051056800049801.git-patchwork-notify@kernel.org>
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <[email protected]>:

On Fri, 31 Jul 2026 17:47:38 +0200 you wrote:
> airoha_alloc_gdm_device() initializes the txq_lock[] array iterating
> over ARRAY_SIZE(dev->txq_lock). ARRAY_SIZE() expands to
> sizeof(dev->txq_lock) / sizeof((dev->txq_lock)[0]), but on UP builds
> (CONFIG_SMP unset, CONFIG_DEBUG_SPINLOCK unset) arch_spinlock_t is an
> empty struct, so sizeof(spinlock_t) is zero and the expression is a
> compile-time division by zero (undefined behavior), reported by clang
> as "division by zero is undefined [-Wdivision-by-zero]".
> 
> [...]

Here is the summary with links:
  - [net-next] net: airoha: fix ARRAY_SIZE() division by zero on UP builds
    https://git.kernel.org/netdev/net-next/c/c509971352a6

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.