From: Martin Kaiser <martin@kaiser.cx>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
Phillip Potter <phil@philpotter.co.uk>,
Michael Straube <straube.linux@gmail.com>,
Pavel Skripkin <paskripkin@gmail.com>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
Martin Kaiser <martin@kaiser.cx>
Subject: [PATCH 08/20] staging: r8188eu: remove duplicate psta check
Date: Fri, 30 Dec 2022 19:06:34 +0100 [thread overview]
Message-ID: <20221230180646.91008-9-martin@kaiser.cx> (raw)
In-Reply-To: <20221230180646.91008-1-martin@kaiser.cx>
We do not need the psta check in the while loop of rtw_xmitframe_coalesce.
psta is already checked near the start of the function and is not modified
afterwards.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
drivers/staging/r8188eu/core/rtw_xmit.c | 36 ++++++++++++-------------
1 file changed, 17 insertions(+), 19 deletions(-)
diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c
index 62b66a205a06..2bccb9ca42e9 100644
--- a/drivers/staging/r8188eu/core/rtw_xmit.c
+++ b/drivers/staging/r8188eu/core/rtw_xmit.c
@@ -1009,25 +1009,23 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct
/* adding icv, if necessary... */
if (pattrib->iv_len) {
- if (psta) {
- switch (pattrib->encrypt) {
- case _WEP40_:
- case _WEP104_:
- WEP_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx);
- break;
- case _TKIP_:
- if (bmcst)
- TKIP_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx);
- else
- TKIP_IV(pattrib->iv, psta->dot11txpn, 0);
- break;
- case _AES_:
- if (bmcst)
- AES_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx);
- else
- AES_IV(pattrib->iv, psta->dot11txpn, 0);
- break;
- }
+ switch (pattrib->encrypt) {
+ case _WEP40_:
+ case _WEP104_:
+ WEP_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx);
+ break;
+ case _TKIP_:
+ if (bmcst)
+ TKIP_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx);
+ else
+ TKIP_IV(pattrib->iv, psta->dot11txpn, 0);
+ break;
+ case _AES_:
+ if (bmcst)
+ AES_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx);
+ else
+ AES_IV(pattrib->iv, psta->dot11txpn, 0);
+ break;
}
memcpy(pframe, pattrib->iv, pattrib->iv_len);
--
2.30.2
next prev parent reply other threads:[~2022-12-30 18:07 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-30 18:06 [PATCH 00/20] staging: r8188eu: some xmit cleanups Martin Kaiser
2022-12-30 18:06 ` [PATCH 01/20] staging: r8188eu: make xmitframe_swencrypt a void function Martin Kaiser
2022-12-30 18:06 ` [PATCH 02/20] staging: r8188eu: remove some unused CAM defines Martin Kaiser
2022-12-30 18:06 ` [PATCH 03/20] staging: r8188eu: cmd_seq is write-only Martin Kaiser
2022-12-30 18:06 ` [PATCH 04/20] staging: r8188eu: return immediately if we're not meant to encrypt Martin Kaiser
2022-12-30 18:06 ` [PATCH 05/20] staging: r8188eu: remove unused parameter Martin Kaiser
2022-12-30 18:06 ` [PATCH 06/20] staging: r8188eu: simplify rtl8188eu_xmit_tasklet Martin Kaiser
2022-12-30 18:06 ` [PATCH 07/20] staging: r8188eu: remove rtl8188eu_init_xmit_priv Martin Kaiser
2022-12-30 18:06 ` Martin Kaiser [this message]
2022-12-30 18:06 ` [PATCH 09/20] staging: r8188eu: simplify frame type check Martin Kaiser
2022-12-30 18:06 ` [PATCH 10/20] staging: r8188eu: simplify rtw_make_wlanhdr's error handling Martin Kaiser
2022-12-30 18:06 ` [PATCH 11/20] staging: r8188eu: clean up qos_option setting Martin Kaiser
2022-12-30 18:06 ` [PATCH 12/20] staging: r8188eu: remove unused bpending array Martin Kaiser
2022-12-30 18:06 ` [PATCH 13/20] staging: r8188eu: remove unused dma_transfer_addr Martin Kaiser
2022-12-30 18:06 ` [PATCH 14/20] staging: r8188eu: bm_pending is not used Martin Kaiser
2022-12-30 18:06 ` [PATCH 15/20] staging: r8188eu: terminate_xmitthread_sema " Martin Kaiser
2022-12-30 18:06 ` [PATCH 16/20] staging: r8188eu: tx_retevt semaphore " Martin Kaiser
2022-12-30 18:06 ` [PATCH 17/20] staging: r8188eu: remove unnecessary rtw_free_xmitframe call Martin Kaiser
2022-12-30 18:06 ` [PATCH 18/20] staging: r8188eu: phwxmit parameter is unused Martin Kaiser
2022-12-30 18:06 ` [PATCH 19/20] staging: r8188eu: rtw_init_hwxmits is not needed Martin Kaiser
2022-12-30 18:06 ` [PATCH 20/20] staging: r8188eu: we use a constant number of hw_xmit entries Martin Kaiser
2023-01-17 18:33 ` Greg Kroah-Hartman
2022-12-31 10:08 ` [PATCH 00/20] staging: r8188eu: some xmit cleanups Philipp Hortmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221230180646.91008-9-martin@kaiser.cx \
--to=martin@kaiser.cx \
--cc=Larry.Finger@lwfinger.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=paskripkin@gmail.com \
--cc=phil@philpotter.co.uk \
--cc=straube.linux@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®