diff mbox series

[net] wireless: mediatek: mt7921: fix Wformat build warning

Message ID 20211022233251.29987-1-rdunlap@infradead.org (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series [net] wireless: mediatek: mt7921: fix Wformat build warning | expand

Checks

Context Check Description
netdev/apply fail Patch does not apply to net
netdev/tree_selection success Clearly marked for net

Commit Message

Randy Dunlap Oct. 22, 2021, 11:32 p.m. UTC
ARRAY_SIZE() is of type size_t, so the format specfier should
be %zu instead of %lu.

Fixes this build warning:

../drivers/net/wireless/mediatek/mt76/mt7921/main.c: In function ‘mt7921_get_et_stats’:
../drivers/net/wireless/mediatek/mt76/mt7921/main.c:1024:26: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Wformat=]
   dev_err(dev->mt76.dev, "ei: %d  SSTATS_LEN: %lu",

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Sean Wang <sean.wang@mediatek.com>
Cc: linux-wireless@vger.kernel.org
Cc: Felix Fietkau <nbd@nbd.name>
Cc: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Cc: Ryder Lee <ryder.lee@mediatek.com>
Cc: Kalle Valo <kvalo@codeaurora.org>
---
 drivers/net/wireless/mediatek/mt76/mt7921/main.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kalle Valo Oct. 23, 2021, 7:14 a.m. UTC | #1
Randy Dunlap <rdunlap@infradead.org> writes:

> ARRAY_SIZE() is of type size_t, so the format specfier should
> be %zu instead of %lu.
>
> Fixes this build warning:
>
> ../drivers/net/wireless/mediatek/mt76/mt7921/main.c: In function ‘mt7921_get_et_stats’:
> ../drivers/net/wireless/mediatek/mt76/mt7921/main.c:1024:26: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Wformat=]
>    dev_err(dev->mt76.dev, "ei: %d  SSTATS_LEN: %lu",
>
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Sean Wang <sean.wang@mediatek.com>
> Cc: linux-wireless@vger.kernel.org
> Cc: Felix Fietkau <nbd@nbd.name>
> Cc: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
> Cc: Ryder Lee <ryder.lee@mediatek.com>
> Cc: Kalle Valo <kvalo@codeaurora.org>

The subject prefix should be "mt76: mt7921:", I'll fix it during commit.

Felix, I'll take this directly to wireless-drivers-next. Please drop it
from your tree.
Kalle Valo Oct. 23, 2021, 7:29 a.m. UTC | #2
Randy Dunlap <rdunlap@infradead.org> wrote:

> ARRAY_SIZE() is of type size_t, so the format specfier should
> be %zu instead of %lu.
> 
> Fixes this build warning:
> 
> ../drivers/net/wireless/mediatek/mt76/mt7921/main.c: In function ‘mt7921_get_et_stats’:
> ../drivers/net/wireless/mediatek/mt76/mt7921/main.c:1024:26: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Wformat=]
>    dev_err(dev->mt76.dev, "ei: %d  SSTATS_LEN: %lu",
> 
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Sean Wang <sean.wang@mediatek.com>
> Cc: linux-wireless@vger.kernel.org
> Cc: Felix Fietkau <nbd@nbd.name>
> Cc: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
> Cc: Ryder Lee <ryder.lee@mediatek.com>
> Cc: Kalle Valo <kvalo@codeaurora.org>

Patch applied to wireless-drivers-next.git, thanks.

a88cae727b3e mt76: mt7921: fix Wformat build warning
diff mbox series

Patch

--- linux-next-20211022.orig/drivers/net/wireless/mediatek/mt76/mt7921/main.c
+++ linux-next-20211022/drivers/net/wireless/mediatek/mt76/mt7921/main.c
@@ -1021,7 +1021,7 @@  void mt7921_get_et_stats(struct ieee8021
 
 	ei += wi.worker_stat_count;
 	if (ei != ARRAY_SIZE(mt7921_gstrings_stats))
-		dev_err(dev->mt76.dev, "ei: %d  SSTATS_LEN: %lu",
+		dev_err(dev->mt76.dev, "ei: %d  SSTATS_LEN: %zu",
 			ei, ARRAY_SIZE(mt7921_gstrings_stats));
 }