Message ID | 20211022233251.29987-1-rdunlap@infradead.org (mailing list archive) |
---|---|
State | Accepted |
Commit | a88cae727b3e031e1dfd03b5e03eec48f9ef9e6a |
Delegated to: | Kalle Valo |
Headers | show |
Series | [net] wireless: mediatek: mt7921: fix Wformat build warning | expand |
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.
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
--- 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)); }
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(-)