Skip to content

Commit

Permalink
mt76: mt7915: fix some sparse warnings
Browse files Browse the repository at this point in the history
This fixes the following sparse warning:

drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:253:16: sparse: sparse: mixing different enum types:
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:253:16: sparse:    unsigned int enum mt7915_txq_id
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:253:16: sparse:    unsigned int enum mt76_txq_id
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:758:63: sparse: sparse: incorrect type in argument 2 (different address spaces)
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:758:63: sparse:    expected unsigned char const [usertype] *ies
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:758:63: sparse:    got unsigned char const [noderef] <asn:4> *
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:1390:23: sparse: sparse: incorrect type in argument 1 (different base types)
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:1390:23: sparse:    expected unsigned int w
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:1390:23: sparse:    got restricted __le32 [usertype] supp_ht_mcs
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:1390:23: sparse: sparse: restricted __le32 degrades to integer
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:1429:60: sparse: sparse: bad assignment (>>=) to restricted __le16
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:1773:16: sparse: sparse: restricted __le32 degrades to integer

Fixes: 6094f86 ("mt76: mt7915: add HE bss_conf support for interfaces")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
Ryder Lee authored and Felix Fietkau committed May 28, 2020
1 parent 06acdd3 commit f9a5c05
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ static int __mt7915_mcu_msg_send(struct mt7915_dev *dev, struct sk_buff *skb,
{
struct mt7915_mcu_txd *mcu_txd;
u8 seq, pkt_fmt, qidx;
enum mt7915_txq_id txq;
enum mt76_txq_id txq;
__le32 *txd;
u32 val;

Expand Down Expand Up @@ -815,8 +815,7 @@ static void mt7915_check_he_obss_narrow_bw_ru_iter(struct wiphy *wiphy,
struct mt7915_he_obss_narrow_bw_ru_data *data = _data;
const struct element *elem;

elem = cfg80211_find_elem(WLAN_EID_EXT_CAPABILITY, bss->ies->data,
bss->ies->len);
elem = ieee80211_bss_get_elem(bss, WLAN_EID_EXT_CAPABILITY);

if (!elem || elem->datalen < 10 ||
!(elem->data[10] &
Expand Down Expand Up @@ -1954,7 +1953,7 @@ mt7915_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7915_dev *dev,

ra->supp_ht_mcs = *(__le32 *)ra->ht_mcs;
ra->supp_mode |= MODE_HT;
mcs = hweight32(ra->supp_ht_mcs) - 1;
mcs = hweight32(le32_to_cpu(ra->supp_ht_mcs)) - 1;
ra->af = sta->ht_cap.ampdu_factor;
ra->ht_gf = !!(sta->ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD);

Expand All @@ -1972,7 +1971,7 @@ mt7915_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7915_dev *dev,
}

if (sta->vht_cap.vht_supported) {
__le16 mcs_map = sta->vht_cap.vht_mcs.rx_mcs_map;
u16 mcs_map = le16_to_cpu(sta->vht_cap.vht_mcs.rx_mcs_map);
u16 vht_mcs;
u8 af, mcs_prev;

Expand Down Expand Up @@ -2399,7 +2398,7 @@ static int mt7915_mcu_init_download(struct mt7915_dev *dev, u32 addr,
};
int attr;

if (req.addr == MCU_PATCH_ADDRESS)
if (req.addr == cpu_to_le32(MCU_PATCH_ADDRESS))
attr = -MCU_CMD_PATCH_START_REQ;
else
attr = -MCU_CMD_TARGET_ADDRESS_LEN_REQ;
Expand Down

0 comments on commit f9a5c05

Please sign in to comment.