> Open-coding it simplifies the code > > Signed-off-by: Felix Fietkau <nbd@xxxxxxxx> > --- > .../net/wireless/mediatek/mt76/mt76x02_mac.c | 23 ------------------- > .../net/wireless/mediatek/mt76/mt76x02_mac.h | 2 -- > .../net/wireless/mediatek/mt76/mt76x02_util.c | 15 +++++++++--- > 3 files changed, 12 insertions(+), 28 deletions(-) > [...] > @@ -191,8 +191,13 @@ int mt76x02_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif, > msta->wcid.hw_key_idx = -1; > mt76x02_mac_wcid_setup(dev, idx, mvif->idx, sta->addr); > mt76x02_mac_wcid_set_drop(dev, idx, false); > - for (i = 0; i < ARRAY_SIZE(sta->txq); i++) > - mt76x02_txq_init(dev, sta->txq[i]); > + for (i = 0; i < ARRAY_SIZE(sta->txq); i++) { > + struct mt76_txq *mtxq; > + > + mtxq = (struct mt76_txq *) sta->txq[i]->drv_priv; I think sta->txq[i] can be NULL here > + mtxq->wcid = &msta->wcid; > + mt76_txq_init(&dev->mt76, sta->txq[i]); > + } > > if (vif->type == NL80211_IFTYPE_AP) > set_bit(MT_WCID_FLAG_CHECK_PS, &msta->wcid.flags); > @@ -230,11 +235,15 @@ void mt76x02_vif_init(struct mt76x02_dev *dev, struct ieee80211_vif *vif, > unsigned int idx) > { > struct mt76x02_vif *mvif = (struct mt76x02_vif *)vif->drv_priv; > + struct mt76_txq *mtxq; > > mvif->idx = idx; > mvif->group_wcid.idx = MT_VIF_WCID(idx); > mvif->group_wcid.hw_key_idx = -1; > - mt76x02_txq_init(dev, vif->txq); > + mtxq = (struct mt76_txq *) vif->txq->drv_priv; > + mtxq->wcid = &mvif->group_wcid; > + > + mt76_txq_init(&dev->mt76, vif->txq); > } > EXPORT_SYMBOL_GPL(mt76x02_vif_init); > > -- > 2.17.0 > -- UNIX is Sexy: who | grep -i blonde | talk; cd ~; wine; talk; touch; unzip; touch; strip; gasp; finger; gasp; mount; fsck; more; yes; gasp; umount; make clean; sleep