From 8799b624fe744f1cc8a48835c9b6469166ef5188 Mon Sep 17 00:00:00 2001 From: Lorenzo Bianconi Date: Sun, 9 Sep 2018 23:57:54 +0200 Subject: [PATCH] mt76: usb: remove skb check in mt76x{0,2}u mcu routines Remove mt76_mcu_msg_alloc return value check since it is already evaluated in __mt76x02u_mcu_send_msg Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt76x0/mcu.c | 4 ---- drivers/net/wireless/mediatek/mt76/mt76x2u_mcu.c | 20 -------------------- 2 files changed, 24 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/mcu.c b/drivers/net/wireless/mediatek/mt76/mt76x0/mcu.c index 4a5739e..d757cde 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x0/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x0/mcu.c @@ -54,8 +54,6 @@ int mt76x0_mcu_function_select(struct mt76x0_dev *dev, }; skb = mt76_mcu_msg_alloc(dev, &msg, sizeof(msg)); - if (!skb) - return -ENOMEM; return mt76_mcu_send_msg(dev, skb, CMD_FUN_SET_OP, func == 5); } @@ -72,8 +70,6 @@ mt76x0_mcu_calibrate(struct mt76x0_dev *dev, enum mcu_calibrate cal, u32 val) }; skb = mt76_mcu_msg_alloc(dev, &msg, sizeof(msg)); - if (!skb) - return -ENOMEM; return mt76_mcu_send_msg(dev, skb, CMD_CALIBRATION_OP, true); } diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2u_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76x2u_mcu.c index 09afb8c..e93123e 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2u_mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2u_mcu.c @@ -43,8 +43,6 @@ mt76x2u_mcu_function_select(struct mt76x2_dev *dev, enum mcu_function func, struct sk_buff *skb; skb = mt76_mcu_msg_alloc(dev, &msg, sizeof(msg)); - if (!skb) - return -ENOMEM; return mt76_mcu_send_msg(dev, skb, CMD_FUN_SET_OP, func != Q_SELECT); } @@ -61,8 +59,6 @@ int mt76x2u_mcu_set_radio_state(struct mt76x2_dev *dev, bool val) struct sk_buff *skb; skb = mt76_mcu_msg_alloc(dev, &msg, sizeof(msg)); - if (!skb) - return -ENOMEM; return mt76_mcu_send_msg(dev, skb, CMD_POWER_SAVING_OP, false); } @@ -91,8 +87,6 @@ int mt76x2u_mcu_load_cr(struct mt76x2_dev *dev, u8 type, u8 temp_level, /* first set the channel without the extension channel info */ skb = mt76_mcu_msg_alloc(dev, &msg, sizeof(msg)); - if (!skb) - return -ENOMEM; return mt76_mcu_send_msg(dev, skb, CMD_LOAD_CR, true); } @@ -119,18 +113,12 @@ int mt76x2u_mcu_set_channel(struct mt76x2_dev *dev, u8 channel, u8 bw, /* first set the channel without the extension channel info */ skb = mt76_mcu_msg_alloc(dev, &msg, sizeof(msg)); - if (!skb) - return -ENOMEM; - mt76_mcu_send_msg(dev, skb, CMD_SWITCH_CHANNEL_OP, true); usleep_range(5000, 10000); msg.ext_chan = 0xe0 + bw_index; skb = mt76_mcu_msg_alloc(dev, &msg, sizeof(msg)); - if (!skb) - return -ENOMEM; - return mt76_mcu_send_msg(dev, skb, CMD_SWITCH_CHANNEL_OP, true); } @@ -147,8 +135,6 @@ int mt76x2u_mcu_calibrate(struct mt76x2_dev *dev, enum mcu_calibration type, struct sk_buff *skb; skb = mt76_mcu_msg_alloc(dev, &msg, sizeof(msg)); - if (!skb) - return -ENOMEM; return mt76_mcu_send_msg(dev, skb, CMD_CALIBRATION_OP, true); } @@ -168,8 +154,6 @@ int mt76x2u_mcu_init_gain(struct mt76x2_dev *dev, u8 channel, u32 gain, msg.channel |= cpu_to_le32(BIT(31)); skb = mt76_mcu_msg_alloc(dev, &msg, sizeof(msg)); - if (!skb) - return -ENOMEM; return mt76_mcu_send_msg(dev, skb, CMD_INIT_GAIN_OP, true); } @@ -194,8 +178,6 @@ int mt76x2u_mcu_set_dynamic_vga(struct mt76x2_dev *dev, u8 channel, bool ap, msg.channel = cpu_to_le32(val); skb = mt76_mcu_msg_alloc(dev, &msg, sizeof(msg)); - if (!skb) - return -ENOMEM; return mt76_mcu_send_msg(dev, skb, CMD_DYNC_VGA_OP, true); } @@ -212,8 +194,6 @@ int mt76x2u_mcu_tssi_comp(struct mt76x2_dev *dev, struct sk_buff *skb; skb = mt76_mcu_msg_alloc(dev, &msg, sizeof(msg)); - if (!skb) - return -ENOMEM; return mt76_mcu_send_msg(dev, skb, CMD_CALIBRATION_OP, true); } -- 2.7.4