mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pranav Desai <contact.pranavdesai@gmail.com>
To: gregkh@linuxfoundation.org
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	Pranav Desai <contact.pranavdesai@gmail.com>
Subject: [PATCH v3 3/6] staging: rtl8723bs: use u8 for frame types in rtw_security.c
Date: Wed,  7 Oct 2026 17:23:39 +0530	[thread overview]
Message-ID: <20261007115342.1121742-4-contact.pranavdesai@gmail.com> (raw)
In-Reply-To: <20261007115342.1121742-1-contact.pranavdesai@gmail.com>

Replace 'uint' with 'u8' for the 'frtype' and 'frsubtype' variables
in rtw_security.c.

These variables are populated by the GetFrameType() and GetFrameSubType()
macros, which read a 16-bit value but apply a bitwise mask (bits 2-3 for
type, bits 2-7 for subtype). Because the highest possible value after
masking is 252, these variables are guaranteed to fit within an 8-bit
unsigned integer.

Signed-off-by: Pranav Desai <contact.pranavdesai@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_security.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_security.c b/drivers/staging/rtl8723bs/core/rtw_security.c
index 34e35c0eccbc..676587fabfe4 100644
--- a/drivers/staging/rtl8723bs/core/rtw_security.c
+++ b/drivers/staging/rtl8723bs/core/rtw_security.c
@@ -633,7 +633,7 @@ static void construct_mic_iv(u8 *mic_iv,
 			     u8 *mpdu,
 			     uint payload_length,
 			     u8 *pn_vector,
-			     uint frtype)
+			     u8 frtype)
 {
 		signed int i;
 
@@ -669,7 +669,7 @@ static void construct_mic_iv(u8 *mic_iv,
 static void construct_mic_header1(u8 *mic_header1,
 				  signed int header_length,
 				  u8 *mpdu,
-				  uint frtype)
+				  u8 frtype)
 {
 		mic_header1[0] = (u8)((header_length - 2) / 256);
 		mic_header1[1] = (u8)((header_length - 2) % 256);
@@ -752,7 +752,7 @@ static void construct_ctr_preload(u8 *ctr_preload,
 				  u8 *mpdu,
 				  u8 *pn_vector,
 				  signed int c,
-				  uint frtype)
+				  u8 frtype)
 {
 	signed int i = 0;
 
@@ -798,8 +798,8 @@ static signed int aes_cipher(u8 *key, u16 hdrlen,
 	u8 aes_out[16] = {};
 	u8 padded_buffer[16] = {};
 	u8 mic[8];
-	uint	frtype  = GetFrameType(pframe);
-	uint	frsubtype  = GetFrameSubType(pframe);
+	u8 frtype  = GetFrameType(pframe);
+	u8 frsubtype  = GetFrameSubType(pframe);
 
 	frsubtype = frsubtype >> 4;
 
@@ -1001,8 +1001,8 @@ static signed int aes_decipher(u8 *key, u8 hdrlen,
 	u8 padded_buffer[16] = {};
 	u8 mic[8];
 
-	uint frtype  = GetFrameType(pframe);
-	uint frsubtype  = GetFrameSubType(pframe);
+	u8 frtype  = GetFrameType(pframe);
+	u8 frsubtype  = GetFrameSubType(pframe);
 
 	frsubtype = frsubtype >> 4;
 
-- 
2.55.0


  parent reply	other threads:[~2026-10-07 11:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-07 11:53 [PATCH v3 0/6] staging: rtl8723bs: explicitly type variables " Pranav Desai
2026-10-07 11:53 ` [PATCH v3 1/6] staging: rtl8723bs: use explicit types for lengths " Pranav Desai
2026-10-07 11:53 ` [PATCH v3 2/6] staging: rtl8723bs: use bool for flags " Pranav Desai
2026-10-07 11:53 ` Pranav Desai [this message]
2026-10-07 11:53 ` [PATCH v3 4/6] staging: rtl8723bs: use explicit types for math variables and iterators Pranav Desai
2026-10-07 11:53 ` [PATCH v3 5/6] staging: rtl8723bs: use u32 for payload_length in rtw_security.c Pranav Desai
2026-10-07 11:53 ` [PATCH v3 6/6] staging: rtl8723bs: use u32 for length variables in rtw_BIP_verify() Pranav Desai

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=20261007115342.1121742-4-contact.pranavdesai@gmail.com \
    --to=contact.pranavdesai@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®