Re: [PATCH net-next] net: airoha: fix ARRAY_SIZE() division by zero on UP builds
[email protected] Wed, 05 Aug 2026 01:00:08 +0000
| Newsgroups | gmane.linux.network,gmane.linux.ports.arm.kernel,gmane.linux.ports.arm.mediatek |
|---|---|
| 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