From patchwork Tue Dec 6 10:49:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kosyh X-Patchwork-Id: 30235 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2748839wrr; Tue, 6 Dec 2022 02:51:31 -0800 (PST) X-Google-Smtp-Source: AA0mqf639eCObC6fOuVXEhpurObkJGyBSpingyOxJXTzppkImyLnRxw6vyBihEZvgpt1rM6aEYl6 X-Received: by 2002:a17:906:b04e:b0:7ad:d7f9:1f88 with SMTP id bj14-20020a170906b04e00b007add7f91f88mr61404339ejb.217.1670323891266; Tue, 06 Dec 2022 02:51:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670323891; cv=none; d=google.com; s=arc-20160816; b=bjE35sOUl34RK1J3mBaSrjtp7Iz5j3526LazFsSDQCzQq+KdGtsPDcznCDTsYhFv5Y yn9XcFprFJYM/H8y5RiWmV569qhFrht6sn0AYsY26H9xDK6AxDaOeiUBj4mZMqlCIhx/ WkzhLrGq/tm461gOsQw9ao7rn4QsbILJWW1GiA7/AKb3PQLYv/EQhe0pVMUfqReyHmer 0YhBdJDaq5i4cKuooNivDJooZX+z2YJodDTG0Qih6iBPZ385NicbPYw4w4+qUlTAx19y 9Sjq6imWX38rnxc3+Ee3prcgx7+sfGHQnCR4RNBPuhbDrqZJ7DPMhPy+Gact0j9Ytrtq IuOA== 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=nX5rRc1fYE1rUYGX4czhmXiyglfPlnnMYmPDIfaYWsI=; b=jRhebSbT/8L7cbVdxmXgCCkHVIPFT88vLSAj1OKhs4o0DlnFI6rJPgTFfr7VwO4L5s P3HNzrQRnK8is9FxR1P1ruI8yK0ByD8u3odhr9EdikV7lmxges41k5hSslcvf3wEiI1W h0o+2jPG53kOZ2q+tE8AxFOYwVvwG+G5KDZ3UFAYIVUtyedO3KONGnAEAl/IznPpWT7H Ex7WbU+RNYXbaF1oq8fNBSXlZYn0ESZbtz7FD/j4+pdMjHMMV55Nt6wtrc1x7Sap7SR2 nWuPu7H0fksX61fgj02z50LywMvnyzdSJbhKtPDaJuHzUogTmJ6UdHs7RqN3HoSzYMx3 3+AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=WK3fA+FO; 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=NONE dis=NONE) header.from=yandex.ru Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d25-20020aa7ce19000000b00461a144e981si1537840edv.356.2022.12.06.02.51.07; Tue, 06 Dec 2022 02:51:31 -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=@yandex.ru header.s=mail header.b=WK3fA+FO; 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=NONE dis=NONE) header.from=yandex.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234271AbiLFKtj (ORCPT + 99 others); Tue, 6 Dec 2022 05:49:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230437AbiLFKtc (ORCPT ); Tue, 6 Dec 2022 05:49:32 -0500 Received: from forward101p.mail.yandex.net (forward101p.mail.yandex.net [77.88.28.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50C1C64CE for ; Tue, 6 Dec 2022 02:49:31 -0800 (PST) Received: from iva8-7349aab11ef6.qloud-c.yandex.net (iva8-7349aab11ef6.qloud-c.yandex.net [IPv6:2a02:6b8:c0c:77a0:0:640:7349:aab1]) by forward101p.mail.yandex.net (Yandex) with ESMTP id DC8CF59CDB63; Tue, 6 Dec 2022 13:49:25 +0300 (MSK) Received: by iva8-7349aab11ef6.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id KnUKKV0YX8c1-DP2ttQIo; Tue, 06 Dec 2022 13:49:25 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1670323765; bh=nX5rRc1fYE1rUYGX4czhmXiyglfPlnnMYmPDIfaYWsI=; h=Message-Id:Date:Cc:Subject:To:From; b=WK3fA+FOCJEB15gwNSdsUK768K+sa5yZwNsulpHDlfd6eYEXrHzrXuFgePewB+z88 mpsTm+QFta0iO1D0DehajL1WZ/SHFa6yjbuQvN2F+hJ8nMV8ERC5ipJlSVuJM24474 s16qeLQ1SYkWydmYRmD6tVp9Exx2qMS3RX+9oeDQ= Authentication-Results: iva8-7349aab11ef6.qloud-c.yandex.net; dkim=pass header.i=@yandex.ru From: Peter Kosyh To: Ping-Ke Shih Cc: Peter Kosyh , Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: [PATCH] rtlwifi: btcoexist: fix conditions branches that are never executed Date: Tue, 6 Dec 2022 13:49:19 +0300 Message-Id: <20221206104919.739746-1-pkosyh@yandex.ru> X-Mailer: git-send-email 2.38.1 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,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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?1751461544798509012?= X-GMAIL-MSGID: =?utf-8?q?1751461544798509012?= Commit 40ca18823515 ("rtlwifi: btcoex: 23b 1ant: fine tune for wifi not connected") introduced never executed branches. Compile test only. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Peter Kosyh Acked-by: Ping-Ke Shih --- I'm not sure that patch do right thing! But these two places are really never executed and should be fixed. I hope that Ping-Ka could check this. .../net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b1ant.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b1ant.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b1ant.c index 70492929d7e4..039bbedb41c2 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b1ant.c +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b1ant.c @@ -1903,7 +1903,7 @@ btc8723b1ant_action_wifi_not_conn_scan(struct btc_coexist *btcoexist) true, 32); halbtc8723b1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 4); - } else if (bt_link_info->a2dp_exist) { + } else if (bt_link_info->pan_exist) { halbtc8723b1ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 22); halbtc8723b1ant_coex_table_with_type(btcoexist, @@ -1964,8 +1964,7 @@ static void btc8723b1ant_action_wifi_conn_scan(struct btc_coexist *btcoexist) true, 32); halbtc8723b1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 4); - } else if (bt_link_info->a2dp_exist && - bt_link_info->pan_exist) { + } else if (bt_link_info->pan_exist) { halbtc8723b1ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 22); halbtc8723b1ant_coex_table_with_type(btcoexist,