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 2/6] staging: rtl8723bs: use bool for flags in rtw_security.c
Date: Wed, 7 Oct 2026 17:23:38 +0530 [thread overview]
Message-ID: <20261007115342.1121742-3-contact.pranavdesai@gmail.com> (raw)
In-Reply-To: <20261007115342.1121742-1-contact.pranavdesai@gmail.com>
Replace 'uint' with 'bool' for the 'qc_exists' and 'a4_exists' variables
since they are only used to track true/false state.
Update their assignments from 1/0 to true/false to match the standard
boolean type.
Signed-off-by: Pranav Desai <contact.pranavdesai@gmail.com>
---
drivers/staging/rtl8723bs/core/rtw_security.c | 34 ++++++++++---------
1 file changed, 18 insertions(+), 16 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_security.c b/drivers/staging/rtl8723bs/core/rtw_security.c
index af461971c827..34e35c0eccbc 100644
--- a/drivers/staging/rtl8723bs/core/rtw_security.c
+++ b/drivers/staging/rtl8723bs/core/rtw_security.c
@@ -628,8 +628,8 @@ static void aes128k128d(u8 *key, u8 *data, u8 *ciphertext)
/* nonce */
/************************************************/
static void construct_mic_iv(u8 *mic_iv,
- signed int qc_exists,
- signed int a4_exists,
+ bool qc_exists,
+ bool a4_exists,
u8 *mpdu,
uint payload_length,
u8 *pn_vector,
@@ -702,8 +702,8 @@ static void construct_mic_header1(u8 *mic_header1,
/************************************************/
static void construct_mic_header2(u8 *mic_header2,
u8 *mpdu,
- signed int a4_exists,
- signed int qc_exists)
+ bool a4_exists,
+ bool qc_exists)
{
signed int i;
@@ -783,7 +783,8 @@ static void construct_ctr_preload(u8 *ctr_preload,
static signed int aes_cipher(u8 *key, u16 hdrlen,
u8 *pframe, u32 plen)
{
- uint qc_exists, a4_exists, i, j, payload_remainder,
+ bool qc_exists, a4_exists;
+ uint i, j, payload_remainder,
num_blocks, payload_index;
u8 pn_vector[6];
@@ -803,14 +804,14 @@ static signed int aes_cipher(u8 *key, u16 hdrlen,
frsubtype = frsubtype >> 4;
if ((hdrlen == WLAN_HDR_A3_LEN) || (hdrlen == WLAN_HDR_A3_QOS_LEN))
- a4_exists = 0;
+ a4_exists = false;
else
- a4_exists = 1;
+ a4_exists = true;
if (((frtype | frsubtype) == WIFI_DATA_CFACK) ||
((frtype | frsubtype) == WIFI_DATA_CFPOLL) ||
((frtype | frsubtype) == WIFI_DATA_CFACKPOLL)) {
- qc_exists = 1;
+ qc_exists = true;
if (hdrlen != WLAN_HDR_A3_QOS_LEN)
hdrlen += 2;
@@ -822,9 +823,9 @@ static signed int aes_cipher(u8 *key, u16 hdrlen,
if (hdrlen != WLAN_HDR_A3_QOS_LEN)
hdrlen += 2;
- qc_exists = 1;
+ qc_exists = true;
} else {
- qc_exists = 0;
+ qc_exists = false;
}
pn_vector[0] = pframe[hdrlen];
@@ -984,7 +985,8 @@ static signed int aes_decipher(u8 *key, u8 hdrlen,
u8 *pframe, u32 plen)
{
static u8 message[MAX_MSG_SIZE];
- uint qc_exists, a4_exists, i, j, payload_remainder,
+ bool qc_exists, a4_exists;
+ uint i, j, payload_remainder,
num_blocks, payload_index;
signed int res = _SUCCESS;
u8 pn_vector[6];
@@ -1018,14 +1020,14 @@ static signed int aes_decipher(u8 *key, u8 hdrlen,
pn_vector[5] = pframe[hdrlen + 7];
if ((hdrlen == WLAN_HDR_A3_LEN) || (hdrlen == WLAN_HDR_A3_QOS_LEN))
- a4_exists = 0;
+ a4_exists = false;
else
- a4_exists = 1;
+ a4_exists = true;
if (((frtype | frsubtype) == WIFI_DATA_CFACK) ||
((frtype | frsubtype) == WIFI_DATA_CFPOLL) ||
((frtype | frsubtype) == WIFI_DATA_CFACKPOLL)) {
- qc_exists = 1;
+ qc_exists = true;
if (hdrlen != WLAN_HDR_A3_QOS_LEN)
hdrlen += 2;
@@ -1037,9 +1039,9 @@ static signed int aes_decipher(u8 *key, u8 hdrlen,
if (hdrlen != WLAN_HDR_A3_QOS_LEN)
hdrlen += 2;
- qc_exists = 1;
+ qc_exists = true;
} else {
- qc_exists = 0;
+ qc_exists = false;
}
/* now, decrypt pframe with hdrlen offset and plen long */
--
2.55.0
next prev 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 ` Pranav Desai [this message]
2026-10-07 11:53 ` [PATCH v3 3/6] staging: rtl8723bs: use u8 for frame types " Pranav Desai
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-3-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®