From patchwork Fri Dec 2 09:25:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 28818 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp733438wrr; Fri, 2 Dec 2022 01:28:51 -0800 (PST) X-Google-Smtp-Source: AA0mqf5Lqh1VK3n0l1S/ytk0ARM5sQ0VmBGDD0F6/0tJ8nuVTAPXQ51ms5jdpBrwwCMAhphqSkRW X-Received: by 2002:a63:5d06:0:b0:46f:be60:ad82 with SMTP id r6-20020a635d06000000b0046fbe60ad82mr45503622pgb.34.1669973331044; Fri, 02 Dec 2022 01:28:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669973331; cv=none; d=google.com; s=arc-20160816; b=sZOpzlD/asupB1jw4moq2WKlX2UhJJllZfiAt3xwNDv1q6a1wmjIpLvKBgekEarFzB epH+iVhEmWQdYo3ZQI8Nu3iy7qDuCT/onoWV5PZeqbSEaQvx1JcWeAGiFYQYohkb2SC8 ztv8VGt2xN3KYyY93wv0OTmYwSQKpAPIL9rJf/AbD75TCpXlW8Tph9FTbCGOaoRxCokv 8t6ZiYdJbW9HEYsPR1c9jgQRjj+amtBesU3Qz/vABXGA37Yldv3BAi08Jh9hlgfzvhP3 8Lf5AlciK9N5+B68VDUKt/nho/nlVsUt4URwgsoQILFRzF+D6TRBwtTa8Qbdu9bvIBHi Jvgg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=j48oknXCLvpfqiDHt6BFPFjX6MffNcci/FdEyIw5zdI=; b=gIpVqPnwHPJQebziwJj8bVvcWuFkEmAAGtQ9dzey+xP2PAWS4EEM+9YQcZe9RupOZT x6NAUtNW8eMuUH/B8Y06gXMO870MSz616waAe7cs9MFqLqcQWKfAAKOw7zArQW9mUaw5 atTkhtEIrsr7vJGI8f0iv9vele7HnvM2tnkbMSDUy5cq4aa8K9KM0gxtjfQTrh7gzQF6 3/mPAjjWPZ0ed5eYsnFB33Oiz/sKNPfoX4z7KK/u/p6mc20Gu848zCrGZ0QgAOrpWBe5 cwMgb5TLmciCvFEhW8R6bAZ3+0K6/wLVbvQXfxuuwBvCAzcScqUeiKN6Tc6SCMz+Xjeq jaew== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s14-20020a056a0008ce00b0055706edd79csi7481574pfu.240.2022.12.02.01.28.38; Fri, 02 Dec 2022 01:28:51 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232893AbiLBJZ4 (ORCPT + 99 others); Fri, 2 Dec 2022 04:25:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229719AbiLBJZh (ORCPT ); Fri, 2 Dec 2022 04:25:37 -0500 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57C9B5FAB for ; Fri, 2 Dec 2022 01:25:36 -0800 (PST) Received: from ipservice-092-217-087-074.092.217.pools.vodafone-ip.de ([92.217.87.74] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1p12IU-0001tn-8N; Fri, 02 Dec 2022 10:25:30 +0100 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 1/2] staging: r8188eu: merge two probereq_p2p functions Date: Fri, 2 Dec 2022 10:25:24 +0100 Message-Id: <20221202092525.403887-2-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221202092525.403887-1-martin@kaiser.cx> References: <20221202092525.403887-1-martin@kaiser.cx> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE 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?1751093955716118293?= X-GMAIL-MSGID: =?utf-8?q?1751093955716118293?= _issue_probereq_p2p is called only by issue_probereq_p2p. Merge the two functions and remove the unused return value. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index 49e0b50b1243..cf7b39cfb8f4 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -3183,9 +3183,8 @@ void issue_probersp_p2p(struct adapter *padapter, unsigned char *da) dump_mgntframe(padapter, pmgntframe); } -static int _issue_probereq_p2p(struct adapter *padapter, u8 *da) +inline void issue_probereq_p2p(struct adapter *padapter, u8 *da) { - int ret = _FAIL; struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; @@ -3201,7 +3200,7 @@ static int _issue_probereq_p2p(struct adapter *padapter, u8 *da) pmgntframe = alloc_mgtxmitframe(pxmitpriv); if (!pmgntframe) - goto exit; + return; /* update attribute */ pattrib = &pmgntframe->attrib; @@ -3457,15 +3456,6 @@ static int _issue_probereq_p2p(struct adapter *padapter, u8 *da) pattrib->last_txcmdsz = pattrib->pktlen; dump_mgntframe(padapter, pmgntframe); - ret = _SUCCESS; - -exit: - return ret; -} - -inline void issue_probereq_p2p(struct adapter *adapter, u8 *da) -{ - _issue_probereq_p2p(adapter, da); } static s32 rtw_action_public_decache(struct recv_frame *recv_frame, u8 token) From patchwork Fri Dec 2 09:25:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 28826 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp738103wrr; Fri, 2 Dec 2022 01:43:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf7FXX9GBKAXarUWStHAJLHAPTQB9r8uXBsTZqIwJLWk9CykssPLUtrOEXQLQX/WWaY+D3lf X-Received: by 2002:a17:907:a705:b0:78d:3e6b:d402 with SMTP id vw5-20020a170907a70500b0078d3e6bd402mr42806860ejc.563.1669974212758; Fri, 02 Dec 2022 01:43:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669974212; cv=none; d=google.com; s=arc-20160816; b=Z9Zt/n4VHlGEqDiAebWOSpKincCbgdKj5HxHXQ1LCiurIdALHgeh4vwVWTrSlCuksY tgtAd2tDxRNsOKtcCcYliu+izAg1sn8rJp1wZCkhBs1iqdGbD6q8mQceMSwyjFOLLkEf wKYFPUcGtrdX2QDETvbeA97kp3A68xf7LmhsjQbJ4hM3+Hs7gezVjnajy+Ewzmeq+fpd 6SXcQeMiOgyRlXBB3kEU0v6fgacfibNYZmotkXBi0HpOk1idbyuamOm/GXQLl+WoH+Tc 2EuytsUISD9z+UjlNQ0c0iZ3mZAjiT/sg2xPxh9CX9neP3ygoh6YZEdN+kieATfZIPiU W47Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=93p+wOknB1InJF/cQe1HTpvqCPAUd59BmiuJTa5g9Os=; b=VEhIElsDJHJ7osBhT8VGbqO1NQ9CcmgsLF2nN0H3bU5y4TiDKDa1p+lFdthLd6NuBo 1oVUxWApxVB/6pK4lsm285I3fuy3WcPEQm/wAX6y1FqKbK4r2h7Z3Zo7CW3Q8dJkJAOn wamfTxb0bTULbrz6GN10ojac0QMT3YXyxbAHHcQZ9L9BIWX/yK+r9yJzmH2g17b6VqS4 wTfSKB13zsbeX1t36XM6f8Lmu6Kd4mWyRcdDxrgn1r0SiUNWcsnXT6OgRQmVRPb/X4I5 FWyhzyB4lS7m9cUylVkr6SVQDezD4M5a9tFHJavsa0vdPVh4gdjDDi5CzVUmhMVQDHWo 6Ukw== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a8-20020aa7d748000000b0046b32882b04si1551836eds.440.2022.12.02.01.43.09; Fri, 02 Dec 2022 01:43:32 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232477AbiLBJ0F (ORCPT + 99 others); Fri, 2 Dec 2022 04:26:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232774AbiLBJZi (ORCPT ); Fri, 2 Dec 2022 04:25:38 -0500 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60B2113E17 for ; Fri, 2 Dec 2022 01:25:37 -0800 (PST) Received: from ipservice-092-217-087-074.092.217.pools.vodafone-ip.de ([92.217.87.74] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1p12IV-0001tn-E9; Fri, 02 Dec 2022 10:25:31 +0100 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 2/2] staging: r8188eu: remove unused da parameter Date: Fri, 2 Dec 2022 10:25:25 +0100 Message-Id: <20221202092525.403887-3-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221202092525.403887-1-martin@kaiser.cx> References: <20221202092525.403887-1-martin@kaiser.cx> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE 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?1751094880054774689?= X-GMAIL-MSGID: =?utf-8?q?1751094880054774689?= All callers of issue_probereq_p2p set the da parameter to NULL. Remove this parameters and the code that runs only for da != NULL. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 28 ++++++++----------- drivers/staging/r8188eu/core/rtw_p2p.c | 8 +++--- .../staging/r8188eu/include/rtw_mlme_ext.h | 2 +- 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index cf7b39cfb8f4..95a9470f4c99 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -3183,7 +3183,7 @@ void issue_probersp_p2p(struct adapter *padapter, unsigned char *da) dump_mgntframe(padapter, pmgntframe); } -inline void issue_probereq_p2p(struct adapter *padapter, u8 *da) +inline void issue_probereq_p2p(struct adapter *padapter) { struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; @@ -3216,20 +3216,16 @@ inline void issue_probereq_p2p(struct adapter *padapter, u8 *da) fctrl = &pwlanhdr->frame_control; *(fctrl) = 0; - if (da) { - memcpy(pwlanhdr->addr1, da, ETH_ALEN); - memcpy(pwlanhdr->addr3, da, ETH_ALEN); + if ((pwdinfo->p2p_info.scan_op_ch_only) || (pwdinfo->rx_invitereq_info.scan_op_ch_only)) { + /* This two flags will be set when this is only the P2P client mode. */ + memcpy(pwlanhdr->addr1, pwdinfo->p2p_peer_interface_addr, ETH_ALEN); + memcpy(pwlanhdr->addr3, pwdinfo->p2p_peer_interface_addr, ETH_ALEN); } else { - if ((pwdinfo->p2p_info.scan_op_ch_only) || (pwdinfo->rx_invitereq_info.scan_op_ch_only)) { - /* This two flags will be set when this is only the P2P client mode. */ - memcpy(pwlanhdr->addr1, pwdinfo->p2p_peer_interface_addr, ETH_ALEN); - memcpy(pwlanhdr->addr3, pwdinfo->p2p_peer_interface_addr, ETH_ALEN); - } else { - /* broadcast probe request frame */ - eth_broadcast_addr(pwlanhdr->addr1); - eth_broadcast_addr(pwlanhdr->addr3); - } + /* broadcast probe request frame */ + eth_broadcast_addr(pwlanhdr->addr1); + eth_broadcast_addr(pwlanhdr->addr3); } + memcpy(pwlanhdr->addr2, mac, ETH_ALEN); SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); @@ -5867,9 +5863,9 @@ void site_survey(struct adapter *padapter) if (ScanType == SCAN_ACTIVE) { /* obey the channel plan setting... */ if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_SCAN) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH)) { - issue_probereq_p2p(padapter, NULL); - issue_probereq_p2p(padapter, NULL); - issue_probereq_p2p(padapter, NULL); + issue_probereq_p2p(padapter); + issue_probereq_p2p(padapter); + issue_probereq_p2p(padapter); } else { int i; for (i = 0; i < RTW_SSID_SCAN_AMOUNT; i++) { diff --git a/drivers/staging/r8188eu/core/rtw_p2p.c b/drivers/staging/r8188eu/core/rtw_p2p.c index ce05458bd1ad..93d3c9c4399c 100644 --- a/drivers/staging/r8188eu/core/rtw_p2p.c +++ b/drivers/staging/r8188eu/core/rtw_p2p.c @@ -1453,7 +1453,7 @@ static void pre_tx_invitereq_handler(struct adapter *padapter) set_channel_bwmode(padapter, pwdinfo->invitereq_info.peer_ch, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); rtw_mlme_under_site_survey(padapter); - issue_probereq_p2p(padapter, NULL); + issue_probereq_p2p(padapter); _set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT); } @@ -1464,7 +1464,7 @@ static void pre_tx_provdisc_handler(struct adapter *padapter) set_channel_bwmode(padapter, pwdinfo->tx_prov_disc_info.peer_channel_num[0], HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); rtw_mlme_under_site_survey(padapter); - issue_probereq_p2p(padapter, NULL); + issue_probereq_p2p(padapter); _set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT); } @@ -1475,7 +1475,7 @@ static void pre_tx_negoreq_handler(struct adapter *padapter) set_channel_bwmode(padapter, pwdinfo->nego_req_info.peer_channel_num[0], HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); rtw_mlme_under_site_survey(padapter); - issue_probereq_p2p(padapter, NULL); + issue_probereq_p2p(padapter); _set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT); } @@ -1725,7 +1725,7 @@ static void pre_tx_scan_timer_process(struct timer_list *t) if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ)) { if (pwdinfo->tx_prov_disc_info.benable) { /* the provision discovery request frame is trigger to send or not */ p2p_protocol_wk_cmd(adapter, P2P_PRE_TX_PROVDISC_PROCESS_WK); - /* issue_probereq_p2p(adapter, NULL); */ + /* issue_probereq_p2p(adapter); */ /* _set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT); */ } } else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING)) { diff --git a/drivers/staging/r8188eu/include/rtw_mlme_ext.h b/drivers/staging/r8188eu/include/rtw_mlme_ext.h index 6724424a334e..589de7c54d93 100644 --- a/drivers/staging/r8188eu/include/rtw_mlme_ext.h +++ b/drivers/staging/r8188eu/include/rtw_mlme_ext.h @@ -497,7 +497,7 @@ void issue_probersp_p2p(struct adapter *padapter, unsigned char *da); void issue_p2p_provision_request(struct adapter *padapter, u8 *pssid, u8 ussidlen, u8 *pdev_raddr); void issue_p2p_GO_request(struct adapter *padapter, u8 *raddr); -void issue_probereq_p2p(struct adapter *padapter, u8 *da); +void issue_probereq_p2p(struct adapter *padapter); void issue_p2p_invitation_response(struct adapter *padapter, u8 *raddr, u8 dialogToken, u8 success); void issue_p2p_invitation_request(struct adapter *padapter, u8 *raddr);