mt76: mt7615: fix sparse warnings: warning: restricted __le16 degrades to integer
authorLorenzo Bianconi <lorenzo@kernel.org>
Thu, 27 Jun 2019 14:49:44 +0000 (16:49 +0200)
committerFelix Fietkau <nbd@nbd.name>
Thu, 5 Sep 2019 15:42:28 +0000 (17:42 +0200)
Fix the following sparse warning in __mt7615_mcu_msg_send:
drivers/net/wireless/mediatek/mt76/mt7615/mcu.c:78:15: sparse: warning:
restricted __le16 degrades to integer
drivers/net/wireless/mediatek/mt76/mt7615/mcu.c:78:15: sparse: warning:
cast from restricted __le16

Fixes: 04b8e65922f6 ("mt76: add mac80211 driver for MT7615 PCIe-based chipsets")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7615/mcu.c

index cdad2c8dc297170f6653dfaeefd19f4af841d322..282b46c6d33d93391b0e5758cb10c6eee875843d 100644 (file)
@@ -75,7 +75,7 @@ static int __mt7615_mcu_msg_send(struct mt7615_dev *dev, struct sk_buff *skb,
 
        txd = mcu_txd->txd;
 
-       val = FIELD_PREP(MT_TXD0_TX_BYTES, cpu_to_le16(skb->len)) |
+       val = FIELD_PREP(MT_TXD0_TX_BYTES, skb->len) |
              FIELD_PREP(MT_TXD0_P_IDX, MT_TX_PORT_IDX_MCU) |
              FIELD_PREP(MT_TXD0_Q_IDX, q_idx);
        txd[0] = cpu_to_le32(val);