public inbox for outreachy@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH v3] staging: rtl8723bs: modify struct field to use standard bool type
@ 2025-04-03 22:37 Abraham Samuel Adekunle
  2025-04-04  5:09 ` Julia Lawall
  0 siblings, 1 reply; 2+ messages in thread
From: Abraham Samuel Adekunle @ 2025-04-03 22:37 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Julia Lawall, outreachy
  Cc: linux-staging, linux-kernel, Dan Carpenter

The struct field uses the uint values 0 and 1 to represent false and
true values respectively.

Convert cases to use the bool type instead to ensure consistency
with other parts of the containing code where true or false has
been used.

reported by Coccinelle:

Signed-off-by: Abraham Samuel Adekunle <abrahamadekunle50@gmail.com>
---
Changes in v3:
	- Added more patch recipients
Changes in v2:
	- Improved commit message based on suggestion from Julia Lawal
	- Clarity was provided to Greg Kroah-Hartman by Dan Carpenter on why
	it is safe to make the change to the struct.

 drivers/staging/rtl8723bs/core/rtw_ap.c      | 2 +-
 drivers/staging/rtl8723bs/include/sta_info.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c
index ed6942e289a5..82f54f769ed1 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ap.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
@@ -389,7 +389,7 @@ void update_bmc_sta(struct adapter *padapter)
 		psta->qos_option = 0;
 		psta->htpriv.ht_option = false;
 
-		psta->ieee8021x_blocked = 0;
+		psta->ieee8021x_blocked = false;
 
 		memset((void *)&psta->sta_stats, 0, sizeof(struct stainfo_stats));
 
diff --git a/drivers/staging/rtl8723bs/include/sta_info.h b/drivers/staging/rtl8723bs/include/sta_info.h
index b3535fed3de7..63343998266a 100644
--- a/drivers/staging/rtl8723bs/include/sta_info.h
+++ b/drivers/staging/rtl8723bs/include/sta_info.h
@@ -86,7 +86,7 @@ struct sta_info {
 	uint qos_option;
 	u8 hwaddr[ETH_ALEN];
 
-	uint	ieee8021x_blocked;	/* 0: allowed, 1:blocked */
+	bool ieee8021x_blocked;
 	uint	dot118021XPrivacy; /* aes, tkip... */
 	union Keytype	dot11tkiptxmickey;
 	union Keytype	dot11tkiprxmickey;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v3] staging: rtl8723bs: modify struct field to use standard bool type
  2025-04-03 22:37 [PATCH v3] staging: rtl8723bs: modify struct field to use standard bool type Abraham Samuel Adekunle
@ 2025-04-04  5:09 ` Julia Lawall
  0 siblings, 0 replies; 2+ messages in thread
From: Julia Lawall @ 2025-04-04  5:09 UTC (permalink / raw)
  To: Samuel Adekunle Abraham
  Cc: Greg Kroah-Hartman, outreachy, linux-staging, linux-kernel,
	Dan Carpenter


Sent from my iPhone

> On 4 Apr 2025, at 00:37, Abraham Samuel Adekunle <abrahamadekunle50@gmail.com> wrote:
> 
> The struct field uses the uint values 0 and 1 to represent false and
> true values respectively.
> 
> Convert cases to use the bool type instead to ensure consistency
> with other parts of the containing code where true or false has
> been used.

This structure is changing size. You need to acknowledge that and argue why it is ok.


> reported by Coccinelle:
> 
> Signed-off-by: Abraham Samuel Adekunle <abrahamadekunle50@gmail.com>
> ---
> Changes in v3:
>    - Added more patch recipients
> Changes in v2:
>    - Improved commit message based on suggestion from Julia Lawal
>    - Clarity was provided to Greg Kroah-Hartman by Dan Carpenter on why
>    it is safe to make the change to the struct.
> 
> drivers/staging/rtl8723bs/core/rtw_ap.c      | 2 +-
> drivers/staging/rtl8723bs/include/sta_info.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c
> index ed6942e289a5..82f54f769ed1 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_ap.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
> @@ -389,7 +389,7 @@ void update_bmc_sta(struct adapter *padapter)
>        psta->qos_option = 0;
>        psta->htpriv.ht_option = false;
> 
> -        psta->ieee8021x_blocked = 0;
> +        psta->ieee8021x_blocked = false;
> 
>        memset((void *)&psta->sta_stats, 0, sizeof(struct stainfo_stats));
> 
> diff --git a/drivers/staging/rtl8723bs/include/sta_info.h b/drivers/staging/rtl8723bs/include/sta_info.h
> index b3535fed3de7..63343998266a 100644
> --- a/drivers/staging/rtl8723bs/include/sta_info.h
> +++ b/drivers/staging/rtl8723bs/include/sta_info.h
> @@ -86,7 +86,7 @@ struct sta_info {
>    uint qos_option;
>    u8 hwaddr[ETH_ALEN];
> 
> -    uint    ieee8021x_blocked;    /* 0: allowed, 1:blocked */
> +    bool ieee8021x_blocked;
>    uint    dot118021XPrivacy; /* aes, tkip... */
>    union Keytype    dot11tkiptxmickey;
>    union Keytype    dot11tkiprxmickey;
> --
> 2.34.1
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-04-04  5:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-03 22:37 [PATCH v3] staging: rtl8723bs: modify struct field to use standard bool type Abraham Samuel Adekunle
2025-04-04  5:09 ` Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox