Skip to content

Commit

Permalink
mt76: Fix queue ID variable types after mcu queue split
Browse files Browse the repository at this point in the history
Clang warns in both mt7615 and mt7915:

drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:271:9: warning: implicit
conversion from enumeration type 'enum mt76_mcuq_id' to different
enumeration type 'enum mt76_txq_id' [-Wenum-conversion]
                txq = MT_MCUQ_FWDL;
                    ~ ^~~~~~~~~~~~
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:278:9: warning: implicit
conversion from enumeration type 'enum mt76_mcuq_id' to different
enumeration type 'enum mt76_txq_id' [-Wenum-conversion]
                txq = MT_MCUQ_WA;
                    ~ ^~~~~~~~~~
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:282:9: warning: implicit
conversion from enumeration type 'enum mt76_mcuq_id' to different
enumeration type 'enum mt76_txq_id' [-Wenum-conversion]
                txq = MT_MCUQ_WM;
                    ~ ^~~~~~~~~~
3 warnings generated.

drivers/net/wireless/mediatek/mt76/mt7615/mcu.c:238:9: warning: implicit
conversion from enumeration type 'enum mt76_mcuq_id' to different
enumeration type 'enum mt76_txq_id' [-Wenum-conversion]
                qid = MT_MCUQ_WM;
                    ~ ^~~~~~~~~~
drivers/net/wireless/mediatek/mt76/mt7615/mcu.c:240:9: warning: implicit
conversion from enumeration type 'enum mt76_mcuq_id' to different
enumeration type 'enum mt76_txq_id' [-Wenum-conversion]
                qid = MT_MCUQ_FWDL;
                    ~ ^~~~~~~~~~~~
2 warnings generated.

Use the proper type for the queue ID variables to fix these warnings.
Additionally, rename the txq variable in mt7915_mcu_send_message to be
more neutral like mt7615_mcu_send_message.

Fixes: e637763b606b ("mt76: move mcu queues to mt76_dev q_mcu array")
Link: ClangBuiltLinux/linux#1229
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
nathanchance authored and nbd168 committed Jan 4, 2021
1 parent dbba9b9 commit 36a745d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion mt7615/mcu.c
Expand Up @@ -231,7 +231,7 @@ mt7615_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
int cmd, int *seq)
{
struct mt7615_dev *dev = container_of(mdev, struct mt7615_dev, mt76);
enum mt76_txq_id qid;
enum mt76_mcuq_id qid;

mt7615_mcu_fill_msg(dev, skb, cmd, seq);
if (test_bit(MT76_STATE_MCU_RUNNING, &dev->mphy.state))
Expand Down
10 changes: 5 additions & 5 deletions mt7915/mcu.c
Expand Up @@ -255,7 +255,7 @@ mt7915_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
{
struct mt7915_dev *dev = container_of(mdev, struct mt7915_dev, mt76);
struct mt7915_mcu_txd *mcu_txd;
enum mt76_txq_id txq;
enum mt76_mcuq_id qid;
__le32 *txd;
u32 val;
u8 seq;
Expand All @@ -268,15 +268,15 @@ mt7915_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
seq = ++dev->mt76.mcu.msg_seq & 0xf;

if (cmd == -MCU_CMD_FW_SCATTER) {
txq = MT_MCUQ_FWDL;
qid = MT_MCUQ_FWDL;
goto exit;
}

mcu_txd = (struct mt7915_mcu_txd *)skb_push(skb, sizeof(*mcu_txd));
if (test_bit(MT76_STATE_MCU_RUNNING, &dev->mphy.state))
txq = MT_MCUQ_WA;
qid = MT_MCUQ_WA;
else
txq = MT_MCUQ_WM;
qid = MT_MCUQ_WM;

txd = mcu_txd->txd;

Expand Down Expand Up @@ -321,7 +321,7 @@ mt7915_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
if (wait_seq)
*wait_seq = seq;

return mt76_tx_queue_skb_raw(dev, mdev->q_mcu[txq], skb, 0);
return mt76_tx_queue_skb_raw(dev, mdev->q_mcu[qid], skb, 0);
}

static void
Expand Down

0 comments on commit 36a745d

Please sign in to comment.