[PATCH mt76] wifi: mt76: dma: Initialize return value in Q_READ() for NPU
Lorenzo Bianconi
lorenzo at kernel.org
Sun Nov 23 05:10:16 PST 2025
Even if this is just a theoretical issue since NPU queues are
initialized just if npu pointer is not NULL, fix the sparse warning
initializing return value in Q_READ macro if CONFIG_MT76_NPU is enabled.
Fixes: 62f1347fa5bf6 ("wifi: mt76: Introduce the NPU generic layer")
Reported-by: kernel test robot <lkp at intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202511231550.NHSRTxxd-lkp@intel.com/
Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>
---
drivers/net/wireless/mediatek/mt76/dma.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mediatek/mt76/dma.h b/drivers/net/wireless/mediatek/mt76/dma.h
index 4fd779e1aa0f8f9c7a465b948e8bcce5f52711cf..4a63de6c5bf5a34cb76f10a427649bc04ebe78b2 100644
--- a/drivers/net/wireless/mediatek/mt76/dma.h
+++ b/drivers/net/wireless/mediatek/mt76/dma.h
@@ -74,7 +74,7 @@
#define Q_READ(_q, _field) ({ \
u32 _offset = offsetof(struct mt76_queue_regs, _field); \
- u32 _val; \
+ u32 _val = 0; \
if ((_q)->flags & MT_QFLAG_NPU) { \
struct airoha_npu *npu; \
\
---
base-commit: e1ed98b1836e2bf0aba98f9790be4f3c6bca9d0d
change-id: 20251123-mt76-npu-fix-warning-aa6ddccee7fc
Best regards,
--
Lorenzo Bianconi <lorenzo at kernel.org>
More information about the Linux-mediatek
mailing list