mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Philipp Hortmann <philipp.g.hortmann@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH v2 4/8] staging: rtl8192e: Use standard function in rtllib_rx_check_duplicate()
Date: Tue, 12 Sep 2023 21:28:25 +0200	[thread overview]
Message-ID: <b74b6ef5e266504b9e3d84495bcd8fe4978b4ded.1694546300.git.philipp.g.hortmann@gmail.com> (raw)
In-Reply-To: <cover.1694546300.git.philipp.g.hortmann@gmail.com>

Use standard function ieee80211_is_beacon() to avoid proprietary code and
to increase readability.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
v1->v2: Take wrongly removed definition of fc back in.
---
 drivers/staging/rtl8192e/rtllib_rx.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
index 89c8d66765fe..7c16d4db67ad 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -904,11 +904,9 @@ static int rtllib_rx_check_duplicate(struct rtllib_device *ieee,
 {
 	struct rtllib_hdr_4addr *hdr = (struct rtllib_hdr_4addr *)skb->data;
 	u16 fc, sc;
-	u8 frag, type, stype;
+	u8 frag;
 
 	fc = le16_to_cpu(hdr->frame_ctl);
-	type = WLAN_FC_GET_TYPE(fc);
-	stype = WLAN_FC_GET_STYPE(fc);
 	sc = le16_to_cpu(hdr->seq_ctl);
 	frag = WLAN_GET_SEQ_FRAG(sc);
 
@@ -916,8 +914,7 @@ static int rtllib_rx_check_duplicate(struct rtllib_device *ieee,
 		!ieee->current_network.qos_data.active ||
 		!IsDataFrame(skb->data) ||
 		IsLegacyDataFrame(skb->data)) {
-		if (!((type == RTLLIB_FTYPE_MGMT) &&
-		      (stype == RTLLIB_STYPE_BEACON))) {
+		if (!ieee80211_is_beacon(hdr->frame_ctl)) {
 			if (is_duplicate_packet(ieee, hdr))
 				return -1;
 		}
-- 
2.42.0


  parent reply	other threads:[~2023-09-12 19:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-12 19:27 [PATCH v2 0/8] staging: rtl8192e: Use standard functions like ieee80211_is_beacon() Philipp Hortmann
2023-09-12 19:28 ` [PATCH v2 1/8] staging: rtl8192e: Remove useless equation in debug output Philipp Hortmann
2023-09-12 19:28 ` [PATCH v2 2/8] staging: rtl8192e: Use standard ieee80211 function in rtllib_rx_mgt() Philipp Hortmann
2023-09-12 19:28 ` [PATCH v2 3/8] staging: rtl8192e: Use standard function in rtllib_process_probe_response() Philipp Hortmann
2023-09-12 19:28 ` Philipp Hortmann [this message]
2023-09-12 19:28 ` [PATCH v2 5/8] staging: rtl8192e: Use standard function in softmac_mgmt_xmit() Philipp Hortmann
2023-09-12 19:28 ` [PATCH v2 6/8] staging: rtl8192e: Replace rtl92e_disable_irq with rtl92e_irq_disable Philipp Hortmann
2023-09-12 19:28 ` [PATCH v2 7/8] staging: rtl8192e: Replace rtl92e_enable_irq with rtl92e_irq_enable Philipp Hortmann
2023-09-12 19:28 ` [PATCH v2 8/8] staging: rtl8192e: Remove rtllib_get_payload() 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=b74b6ef5e266504b9e3d84495bcd8fe4978b4ded.1694546300.git.philipp.g.hortmann@gmail.com \
    --to=philipp.g.hortmann@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    /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®