[PATCH wireless-next] wifi: libertas: if_usb: remove some useless code in if_usb_prog_firmware
Su Hui
suhui at nfschina.com
Tue Nov 21 22:59:09 PST 2023
Clang static checker complains that value stored to 'ret' is never read.
Remove these useless code to save space.
Signed-off-by: Su Hui <suhui at nfschina.com>
---
drivers/net/wireless/marvell/libertas/if_usb.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/marvell/libertas/if_usb.c b/drivers/net/wireless/marvell/libertas/if_usb.c
index 2240b4db8c03..77cc55616ef5 100644
--- a/drivers/net/wireless/marvell/libertas/if_usb.c
+++ b/drivers/net/wireless/marvell/libertas/if_usb.c
@@ -830,10 +830,8 @@ static void if_usb_prog_firmware(struct lbs_private *priv, int ret,
}
cardp->fw = fw;
- if (check_fwfile_format(cardp->fw->data, cardp->fw->size)) {
- ret = -EINVAL;
+ if (check_fwfile_format(cardp->fw->data, cardp->fw->size))
goto done;
- }
/* Cancel any pending usb business */
usb_kill_urb(cardp->rx_urb);
@@ -848,7 +846,6 @@ static void if_usb_prog_firmware(struct lbs_private *priv, int ret,
restart:
if (if_usb_submit_rx_urb_fwload(cardp) < 0) {
lbs_deb_usbd(&cardp->udev->dev, "URB submission is failed\n");
- ret = -EIO;
goto done;
}
@@ -866,18 +863,15 @@ static void if_usb_prog_firmware(struct lbs_private *priv, int ret,
if (cardp->bootcmdresp == BOOT_CMD_RESP_NOT_SUPPORTED) {
/* Return to normal operation */
- ret = -EOPNOTSUPP;
usb_kill_urb(cardp->rx_urb);
usb_kill_urb(cardp->tx_urb);
- if (if_usb_submit_rx_urb(cardp) < 0)
- ret = -EIO;
+ if_usb_submit_rx_urb(cardp);
goto done;
} else if (cardp->bootcmdresp <= 0) {
if (--reset_count >= 0) {
if_usb_reset_device(cardp);
goto restart;
}
- ret = -EIO;
goto done;
}
@@ -908,7 +902,6 @@ static void if_usb_prog_firmware(struct lbs_private *priv, int ret,
}
pr_info("FW download failure, time = %d ms\n", i * 100);
- ret = -EIO;
goto done;
}
--
2.30.2
More information about the libertas-dev
mailing list