From patchwork Mon Nov 13 14:47:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Antipov X-Patchwork-Id: 13454071 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C85BDC4167D for ; Mon, 13 Nov 2023 14:48:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230124AbjKMOsw (ORCPT ); Mon, 13 Nov 2023 09:48:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229612AbjKMOsv (ORCPT ); Mon, 13 Nov 2023 09:48:51 -0500 Received: from forward100c.mail.yandex.net (forward100c.mail.yandex.net [178.154.239.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5850CD68 for ; Mon, 13 Nov 2023 06:48:44 -0800 (PST) Received: from mail-nwsmtp-smtp-production-main-45.myt.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-45.myt.yp-c.yandex.net [IPv6:2a02:6b8:c00:2f9f:0:640:dfdd:0]) by forward100c.mail.yandex.net (Yandex) with ESMTP id D5DE360ADA; Mon, 13 Nov 2023 17:48:11 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-45.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id Amj84jlUtuQ0-DhcIPg3s; Mon, 13 Nov 2023 17:48:11 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1699886891; bh=CbaVwtDCYdUUp7vTYFy+ELf6W025N7vHxium9qh0kYQ=; h=Message-ID:Date:Cc:Subject:To:From; b=k1N16EZRxxgteOTolzIWsB6QCCALHiahhT7dXeIA4CZnF00zMoYwdkyVhlBWuZ2vR oKx6AMPn9ONrIPLHCZ+eu4ARmtDSHpu7pct2mxxQxWHmmTDMoZC9uyoZl/LmcYIEIT SFedB9GaSRDJzobO8ImxJFKYur8xFtwW+tOSscTQ= Authentication-Results: mail-nwsmtp-smtp-production-main-45.myt.yp-c.yandex.net; dkim=pass header.i=@yandex.ru From: Dmitry Antipov To: Ping-Ke Shih Cc: Kalle Valo , linux-wireless@vger.kernel.org, lvc-project@linuxtesting.org, Dmitry Antipov Subject: [PATCH 1/2] wifi: rtlwifi: more cleanup for struct rtl_hal Date: Mon, 13 Nov 2023 17:47:29 +0300 Message-ID: <20231113144734.197359-1-dmantipov@yandex.ru> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Following commit d1e6b020c32d ("wifi: rtlwifi: cleanup struct rtl_hal"), remove unused 'hal_coex_8723', 'current_bandtypebackup', 'master_of_dmsp' and 'slave_of_dmsp' members of 'struct rtl_hal' as well. Compile tested only. Signed-off-by: Dmitry Antipov --- drivers/net/wireless/realtek/rtlwifi/wifi.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/wifi.h b/drivers/net/wireless/realtek/rtlwifi/wifi.h index 171a461cd812..33c3e001266f 100644 --- a/drivers/net/wireless/realtek/rtlwifi/wifi.h +++ b/drivers/net/wireless/realtek/rtlwifi/wifi.h @@ -1605,7 +1605,6 @@ struct rtl_hal { bool being_init_adapter; bool mac_func_enable; bool pre_edcca_enable; - struct bt_coexist_8723 hal_coex_8723; enum intf_type interface; u16 hw_type; /*92c or 92d or 92s and so on */ @@ -1660,7 +1659,6 @@ struct rtl_hal { /* Dual mac */ enum macphy_mode macphymode; enum band_type current_bandtype; /* 0:2.4G, 1:5G */ - enum band_type current_bandtypebackup; enum band_type bandset; /* dual MAC 0--Mac0 1--Mac1 */ u32 interfaceindex; @@ -1678,8 +1676,6 @@ struct rtl_hal { bool load_imrandiqk_setting_for2g; bool disable_amsdu_8k; - bool master_of_dmsp; - bool slave_of_dmsp; /*for wowlan*/ bool enter_pnp_sleep; From patchwork Mon Nov 13 14:47:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Antipov X-Patchwork-Id: 13454070 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44814C4332F for ; Mon, 13 Nov 2023 14:48:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230056AbjKMOsw (ORCPT ); Mon, 13 Nov 2023 09:48:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229626AbjKMOsv (ORCPT ); Mon, 13 Nov 2023 09:48:51 -0500 Received: from forward100c.mail.yandex.net (forward100c.mail.yandex.net [178.154.239.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D2A71A5 for ; Mon, 13 Nov 2023 06:48:44 -0800 (PST) Received: from mail-nwsmtp-smtp-production-main-45.myt.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-45.myt.yp-c.yandex.net [IPv6:2a02:6b8:c00:2f9f:0:640:dfdd:0]) by forward100c.mail.yandex.net (Yandex) with ESMTP id 6A5886090D; Mon, 13 Nov 2023 17:48:12 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-45.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id Amj84jlUtuQ0-NiaHArxL; Mon, 13 Nov 2023 17:48:12 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1699886892; bh=LTQa9sc17ntD9uNZCs1vpw8MhnFcVfJo2L9K62kMj0Y=; h=Message-ID:Date:In-Reply-To:Cc:Subject:References:To:From; b=m3vdNVViCbOa0q5me1hZmKRbg7iDu/ANCess5OXbzhh8iFUi0ixhQjNjzu4WFNqTC dXI/xBhfbQ+UJToNkhyGHW9HlWW6lLAnOrfZLP0k4ecypYZ/X6NsAIS52210DY6887 ZloyEqt/nPbBcBVQiMWCKLnJ/+jx7lvYBiLkfTOg= Authentication-Results: mail-nwsmtp-smtp-production-main-45.myt.yp-c.yandex.net; dkim=pass header.i=@yandex.ru From: Dmitry Antipov To: Ping-Ke Shih Cc: Kalle Valo , linux-wireless@vger.kernel.org, lvc-project@linuxtesting.org, Dmitry Antipov Subject: [PATCH 2/2] wifi: rtlwifi: simplify rtl_action_proc() and rtl_tx_agg_start() Date: Mon, 13 Nov 2023 17:47:30 +0300 Message-ID: <20231113144734.197359-2-dmantipov@yandex.ru> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231113144734.197359-1-dmantipov@yandex.ru> References: <20231113144734.197359-1-dmantipov@yandex.ru> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Since 'drv_priv' is an in-place member allocated at the end of 'struct ieee80211_sta', it can't be NULL and so relevant checks in 'rtl_action_proc()' and 'rtl_tx_agg_start()' may be dropped. Compile tested only. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Antipov Acked-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtlwifi/base.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c b/drivers/net/wireless/realtek/rtlwifi/base.c index 7ce37fb4fdbf..1a8d715b7c07 100644 --- a/drivers/net/wireless/realtek/rtlwifi/base.c +++ b/drivers/net/wireless/realtek/rtlwifi/base.c @@ -1402,10 +1402,6 @@ bool rtl_action_proc(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx) sta_entry = (struct rtl_sta_info *)sta->drv_priv; - if (!sta_entry) { - rcu_read_unlock(); - return true; - } capab = le16_to_cpu(mgmt->u.action.u.addba_req.capab); tid = (capab & @@ -1760,8 +1756,6 @@ int rtl_tx_agg_start(struct ieee80211_hw *hw, struct ieee80211_vif *vif, return -EINVAL; sta_entry = (struct rtl_sta_info *)sta->drv_priv; - if (!sta_entry) - return -ENXIO; tid_data = &sta_entry->tids[tid]; rtl_dbg(rtlpriv, COMP_SEND, DBG_DMESG, @@ -1818,8 +1812,6 @@ int rtl_rx_agg_start(struct ieee80211_hw *hw, } sta_entry = (struct rtl_sta_info *)sta->drv_priv; - if (!sta_entry) - return -ENXIO; tid_data = &sta_entry->tids[tid]; rtl_dbg(rtlpriv, COMP_RECV, DBG_DMESG,