[bug report] wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices
Dan Carpenter
error27 at gmail.com
Sat Dec 3 04:54:53 PST 2022
Hello Shayne Chen,
The patch 98686cd21624: "wifi: mt76: mt7996: add driver for MediaTek
Wi-Fi 7 (802.11be) devices" from Nov 22, 2022, leads to the following
Smatch static checker warning:
drivers/net/wireless/mediatek/mt76/mt7996/debugfs.c:657 mt7996_rf_regval_set()
warn: passing casted pointer '&val' to 'mt7996_mcu_rf_regval()' 64 vs 32.
drivers/net/wireless/mediatek/mt76/mt7996/debugfs.c
652 static int
653 mt7996_rf_regval_set(void *data, u64 val)
654 {
655 struct mt7996_dev *dev = data;
656
--> 657 return mt7996_mcu_rf_regval(dev, dev->mt76.debugfs_reg, (u32 *)&val, true);
^^^^^^^^^^^
This code only "works" on little endian systems. You have to do
something like:
u32 u32_val = val;
return mt7996_mcu_rf_regval(dev, dev->mt76.debugfs_reg, &u32_val, true);
658 }
regards,
dan carpenter
More information about the Linux-mediatek
mailing list