Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp900570rdf; Tue, 21 Nov 2023 23:00:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IEibngWL4rhw8bZ5dKgVykENx9dfHN/kabwpo2XNO+LuTRKaFR1YVzh5rb1nxsgBwFaKdgq X-Received: by 2002:a05:6a00:1daa:b0:6c3:4c72:8d17 with SMTP id z42-20020a056a001daa00b006c34c728d17mr1815517pfw.3.1700636404323; Tue, 21 Nov 2023 23:00:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700636404; cv=none; d=google.com; s=arc-20160816; b=pkn2bOnXBeCumLzWBs5xWpYtjSTR2a1VkhptfTP13AGhfsexZIL2ZdW8FK6vnt8dSj SMe9weet3l9sYzi/LWtLts+XGgbfrZZpijUxwJ3hXCp0pKWXssABlBOA0FA620TdCsIj MypqpgctTiR3b2URfkgGD7cKZ0+MXmBRdx7wzH3hO2Ehw49PgZQ+n9Ph+ciLzcKKYDMD v8Aw3JGSUzfGQln3aXDpDIs6L0Cmg9QHQsP3oS7hE3jh7Go8+Kg3cJJnA/gfxsEZJg/H BkwsxAsr7Je6NspQ35/QqWumUrqRgEPS5RRFe7EwwZNhlAfAH5G248g0tZoxrhdslFhb R9xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=BqVlPEIeyXmZxOTGLjtFJIOyGQi48Rhy7a2LScmRF6o=; fh=UW29AZETBk1ztjzqW9+UvZq0p79FHM/1xbwifpf2V+0=; b=YMnjGeeKdVp89GHwjprnvk2VcRTyZK1zoiNDaiekXt24S03OUQVIcmTWgx3xEjaW83 tjL1WNqw2mjOVbx/pGUyyRDRnogotv9JBG+RKdRy9BH+YU5YOl8+y/RVL/vr4Juha9x+ k9/s4HcS9nPEEFRGal7d4QWUIwOJdcQIfihy2/R8QZqKDyMtOnZj/J/nYPPsaEaj6+Lb QhvZIa6TMBhZvGKyJ6j/PXShB81kcth0F4QZl89H5cocK0r3ZVqQlQFb1IJiprjUAaAC tZW6tIzTOiqg5mTIDbrG1baxL7XuJJ54YBkTXGH8yTB4D74UN1fnWz23xthemw5Qb4Sm DtYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id fj36-20020a056a003a2400b006c3463c7299si12109577pfb.197.2023.11.21.23.00.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 23:00:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 6FAB0819DFDE; Tue, 21 Nov 2023 23:00:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230061AbjKVHAE (ORCPT + 54 others); Wed, 22 Nov 2023 02:00:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229931AbjKVHAC (ORCPT ); Wed, 22 Nov 2023 02:00:02 -0500 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 13EF9DD; Tue, 21 Nov 2023 22:59:57 -0800 (PST) Received: from localhost.localdomain (unknown [180.167.10.98]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id E795A606AC67E; Wed, 22 Nov 2023 14:59:53 +0800 (CST) X-MD-Sfrom: suhui@nfschina.com X-MD-SrcIP: 180.167.10.98 From: Su Hui To: kvalo@kernel.org, nathan@kernel.org, ndesaulniers@google.com, trix@redhat.com Cc: Su Hui , yangyingliang@huawei.com, libertas-dev@lists.infradead.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, kernel-janitors@vger.kernel.org Subject: [PATCH wireless-next] wifi: libertas: if_usb: remove some useless code in if_usb_prog_firmware Date: Wed, 22 Nov 2023 14:59:09 +0800 Message-Id: <20231122065908.907045-1-suhui@nfschina.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,RDNS_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 21 Nov 2023 23:00:03 -0800 (PST) Clang static checker complains that value stored to 'ret' is never read. Remove these useless code to save space. Signed-off-by: Su Hui --- 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