From patchwork Sat Feb 18 13:00:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Korotkov X-Patchwork-Id: 58929 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp370442wrn; Sat, 18 Feb 2023 05:26:29 -0800 (PST) X-Google-Smtp-Source: AK7set9+w+T9JRRVjK2O4fyXiGLmYszfASrDbgqyOVzMG1CJslTSoOUPxvyBKhRlG2BZ0oOeYqY2 X-Received: by 2002:a17:907:10d4:b0:8b2:abc7:1ef9 with SMTP id rv20-20020a17090710d400b008b2abc71ef9mr5117187ejb.68.1676726789623; Sat, 18 Feb 2023 05:26:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676726789; cv=none; d=google.com; s=arc-20160816; b=XhbZC/TAfsWcn3s2krsT5DBgkw06RqFWQFno52cJ2ZiaIEWCZzk6Ru2aCrZocyi2yO cEl1hllDWLBexy/OkdOBOmqrPNP3XvUqSrJNOIiAjc1ycEmomFnn5GCTEQ7nMLUm/Tx/ 9ML09xLSiCo79nidqb8r0TGcx6bbz5H+yD00dlm6sJtwYmeZ8ypaoY8cL9lqHSU69/JZ /qqpZ32YJrnYS679uSS2VvVPIYnQL/xCma5xaSLZ8eJQYUmytJQq9rqwYSkWg65ut2K+ va/dyMdn/dqOZRYmhDNKkEk4yLClswVJ0YQuRhwbLE/2TSzhQhIA8rlfhZLeMld+f/oa 0HhA== 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:dkim-signature; bh=BDd4Z6+6MlW0i6nLuKIJnVb+Uvg1qlIV7+KCkuqlt2g=; b=R0JG4jzR7PXnOUqpm6Vcn/N6iXexv0IoxwkYQDUgzCWUVc1ZJUjtKFHNJLUQOvMiXG L7CFltfnOEA8s0Ii0k2KqxeBbSuIU30Wrhb8UVUGYNkZu2wYfSnRF1yjQ0BD2/TrWk7G dCEu4j0Z/PQ0I6giJa2hq2fB4Z09npCNF2vnDfJBJpPXUt+LGGTpArOporLl+rPxXBzd GdqtTPZ6zhFaQGQFnXIWlWBL0W+/zYZTeBfH5LsGqMJEnYVMVzUgFSZenA5QGAyf0o11 g4m2Po4CnPhI2K4MGqLKT391Vj3zfg6EVTpA5A7XkPsPgyhqOBjnauhbtawEBu0p+sxD 5f2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=U+4AB2pP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j9-20020a170906534900b008b17aa97586si7709640ejo.623.2023.02.18.05.26.06; Sat, 18 Feb 2023 05:26:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=U+4AB2pP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229722AbjBRNEH (ORCPT + 99 others); Sat, 18 Feb 2023 08:04:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229525AbjBRNEF (ORCPT ); Sat, 18 Feb 2023 08:04:05 -0500 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9985C13D7A; Sat, 18 Feb 2023 05:04:04 -0800 (PST) Received: by mail-lj1-x231.google.com with SMTP id bx37so491374ljb.12; Sat, 18 Feb 2023 05:04:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=BDd4Z6+6MlW0i6nLuKIJnVb+Uvg1qlIV7+KCkuqlt2g=; b=U+4AB2pPZXTlmR9Yron8JLy2SjLoCq3Ez6KbCFTn4J5LwbxC9eR/tlmFV2/xX4fTId glMMXjTaLQF4PF4676dVrzKZj/is1hdiS1KeEYaark9fFiQLxFGYKi3JUPqRQyh4poJL opekiF5jpAuTcU8EnV0GE54N/9y0gf3BSrzkLGdWt7exWDqoSKdNyKX8C/eM2DK0JwTy lNFjJsGpFwhdzIygJZKmcUbouQ7VWa6Zl9qLrRTK/iq+PEGtacsGbP1DfIK8Bfm78GIX B0FkvnHFFh4+2HCu7Z01PCmFNp4t8CwzuCCZnq6thZWXw4sToh+9iBeBCskkb7vknlV1 XCDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=BDd4Z6+6MlW0i6nLuKIJnVb+Uvg1qlIV7+KCkuqlt2g=; b=L6OnMtTiSN3zF347uvm1RWiRSZv6L1HjX8r0xoJknC4vnlzlECkZxJHnNTU7kmW5ow EuDbAfeen6Bvi2qwBphEiPg/H2U6hG9YN3ho7BwnRNWnzHzL877lut7wlyr2NHKtfFN1 LKSL1g28vsX+j/9JIxQuexP+DAhJpbw7dlAHZwoFpQsEHPCax07LY/qY/xbiT8vd/Tje UKkzJnhkGKcy5WvP6KNm7OJ3tpxELKDuBdaujRZjWNm3rTRb/O4pxSHE5jBbUYfD0l/a Th768x0iF+pY9SyRMDpsu9tkB5LsGfXekVgOSUAc/hZrFvgEC1uxGfIQWqT1/tbe0iUF Hckg== X-Gm-Message-State: AO0yUKU4oYlgotOuD4+MZRl82f5GBNkwp4a7RCVTYKnvmDpPr9G3eEUE Jgsw8d1XHovrEc0sC1z9WjU= X-Received: by 2002:a2e:a271:0:b0:293:5354:7161 with SMTP id k17-20020a2ea271000000b0029353547161mr1212297ljm.17.1676725442526; Sat, 18 Feb 2023 05:04:02 -0800 (PST) Received: from mkor.. (89-109-49-189.dynamic.mts-nn.ru. [89.109.49.189]) by smtp.gmail.com with ESMTPSA id a14-20020a2e980e000000b00295733a3390sm174062ljj.101.2023.02.18.05.04.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Feb 2023 05:04:02 -0800 (PST) From: Maxim Korotkov To: Rasesh Mody Cc: Maxim Korotkov , GR-Linux-NIC-Dev@marvell.com, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Michael Chan , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: [PATCH] bnx2: remove deadcode in bnx2_init_cpus() Date: Sat, 18 Feb 2023 16:00:16 +0300 Message-Id: <20230218130016.42856-1-korotkov.maxim.s@gmail.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758175470095988312?= X-GMAIL-MSGID: =?utf-8?q?1758175470095988312?= The load_cpu_fw function has no error return code and always returns zero. Checking the value returned by this function does not make sense. As a result, bnx2_init_cpus will also return only zero Found by Security Code and Linux Verification Center (linuxtesting.org) with SVACE Fixes: 57579f7629a3 ("bnx2: Use request_firmware()") Signed-off-by: Maxim Korotkov --- drivers/net/ethernet/broadcom/bnx2.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c index 9f473854b0f4..4dacb65a7348 100644 --- a/drivers/net/ethernet/broadcom/bnx2.c +++ b/drivers/net/ethernet/broadcom/bnx2.c @@ -3908,37 +3908,27 @@ bnx2_init_cpus(struct bnx2 *bp) (const struct bnx2_mips_fw_file *) bp->mips_firmware->data; const struct bnx2_rv2p_fw_file *rv2p_fw = (const struct bnx2_rv2p_fw_file *) bp->rv2p_firmware->data; - int rc; /* Initialize the RV2P processor. */ load_rv2p_fw(bp, RV2P_PROC1, &rv2p_fw->proc1); load_rv2p_fw(bp, RV2P_PROC2, &rv2p_fw->proc2); /* Initialize the RX Processor. */ - rc = load_cpu_fw(bp, &cpu_reg_rxp, &mips_fw->rxp); - if (rc) - goto init_cpu_err; + (void)load_cpu_fw(bp, &cpu_reg_rxp, &mips_fw->rxp); /* Initialize the TX Processor. */ - rc = load_cpu_fw(bp, &cpu_reg_txp, &mips_fw->txp); - if (rc) - goto init_cpu_err; + (void)load_cpu_fw(bp, &cpu_reg_txp, &mips_fw->txp); /* Initialize the TX Patch-up Processor. */ - rc = load_cpu_fw(bp, &cpu_reg_tpat, &mips_fw->tpat); - if (rc) - goto init_cpu_err; + (void)load_cpu_fw(bp, &cpu_reg_tpat, &mips_fw->tpat); /* Initialize the Completion Processor. */ - rc = load_cpu_fw(bp, &cpu_reg_com, &mips_fw->com); - if (rc) - goto init_cpu_err; + (void)load_cpu_fw(bp, &cpu_reg_com, &mips_fw->com); /* Initialize the Command Processor. */ - rc = load_cpu_fw(bp, &cpu_reg_cp, &mips_fw->cp); + (void)load_cpu_fw(bp, &cpu_reg_cp, &mips_fw->cp); -init_cpu_err: - return rc; + return 0; } static void