[PATCH v3 4/6] staging: rtl8723bs: use explicit types for math variables and iterators

From: Pranav Desai

Date: Wed Oct 07 2026 - 08:30:16 EST


Replace 'uint' with explicit types for variables used in math operations
and loops inside the aes_cipher() and aes_decipher() functions:

- Change 'payload_remainder' to u8 because it is calculated as (plen % 16),
which guarantees a range of 0-15.
- Change 'payload_index' to u32 because it indexes into the payload, which
is bounded by plen (u32).
- Change 'num_blocks' to u32 since it is derived from 'plen' (u32).
- Change loop iterators (i, j) to standard 'unsigned int'.

Signed-off-by: Pranav Desai <contact.pranavdesai@xxxxxxxxx>
---
drivers/staging/rtl8723bs/core/rtw_security.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_security.c b/drivers/staging/rtl8723bs/core/rtw_security.c
index 676587fabfe4..ff8af1a29b22 100644
--- a/drivers/staging/rtl8723bs/core/rtw_security.c
+++ b/drivers/staging/rtl8723bs/core/rtw_security.c
@@ -784,8 +784,10 @@ static signed int aes_cipher(u8 *key, u16 hdrlen,
u8 *pframe, u32 plen)
{
bool qc_exists, a4_exists;
- uint i, j, payload_remainder,
- num_blocks, payload_index;
+ u8 payload_remainder;
+ u32 payload_index;
+ u32 num_blocks;
+ unsigned int i, j;

u8 pn_vector[6];
u8 mic_iv[16] = {};
@@ -986,8 +988,10 @@ static signed int aes_decipher(u8 *key, u8 hdrlen,
{
static u8 message[MAX_MSG_SIZE];
bool qc_exists, a4_exists;
- uint i, j, payload_remainder,
- num_blocks, payload_index;
+ u8 payload_remainder;
+ u32 payload_index;
+ u32 num_blocks;
+ unsigned int i, j;
signed int res = _SUCCESS;
u8 pn_vector[6];
u8 mic_iv[16] = {};
--
2.55.0