[PATCH v3 3/6] staging: rtl8723bs: use u8 for frame types in rtw_security.c
From: Pranav Desai
Date: Wed Oct 07 2026 - 08:47:44 EST
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@xxxxxxxxx>
---
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