mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] staging: rtl8723bs: convert swing index variables from u8 to int
       [not found] <YOUR-ORIGINAL-MESSAGE-ID>
@ 2026-08-04 17:01 ` Mohit Mishra
  2026-09-01  9:43   ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Mohit Mishra @ 2026-08-04 17:01 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Dan Carpenter, Nikolay Kulikov, linux-staging, linux-kernel,
	Mohit Mishra

In ODM_TxPwrTrackSetPwr_8723B(), Final_OFDM_Swing_Index and
Final_CCK_Swing_Index are declared as u8. Using u8 for variables involved
in arithmetic calculations and lower-bound comparisons (<= 0) is unusual
and triggers static analysis warnings.

Convert both variables from u8 to int to clean up the variable types,
aligning with the TODO item to "convert any remaining unusual variable
types".

Signed-off-by: Mohit Mishra <mishraloopmohit@gmail.com>
---
 drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
index 6c5f56d5a1f4..2ec2d4aada56 100644
--- a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
+++ b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
@@ -160,8 +160,8 @@ void ODM_TxPwrTrackSetPwr_8723B(
 	u8 PwrTrackingLimit_OFDM = 34; /* 0dB */
 	u8 PwrTrackingLimit_CCK = 28; /* 2dB */
 	u8 TxRate = 0xFF;
-	u8 Final_OFDM_Swing_Index = 0;
-	u8 Final_CCK_Swing_Index = 0;
+	int Final_OFDM_Swing_Index = 0;
+	int Final_CCK_Swing_Index = 0;
 
 	{
 		u16 rate = *(pDM_Odm->pForcedDataRate);
-- 
2.43.0


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

* Re: [PATCH v2] staging: rtl8723bs: convert swing index variables from u8 to int
  2026-08-04 17:01 ` [PATCH v2] staging: rtl8723bs: convert swing index variables from u8 to int Mohit Mishra
@ 2026-09-01  9:43   ` Greg Kroah-Hartman
  2026-09-01 12:51     ` David Laight
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2026-09-01  9:43 UTC (permalink / raw)
  To: Mohit Mishra; +Cc: Dan Carpenter, Nikolay Kulikov, linux-staging, linux-kernel

On Tue, Aug 04, 2026 at 10:31:37PM +0530, Mohit Mishra wrote:
> In ODM_TxPwrTrackSetPwr_8723B(), Final_OFDM_Swing_Index and
> Final_CCK_Swing_Index are declared as u8. Using u8 for variables involved
> in arithmetic calculations and lower-bound comparisons (<= 0) is unusual
> and triggers static analysis warnings.

What warnings?

> Convert both variables from u8 to int to clean up the variable types,
> aligning with the TODO item to "convert any remaining unusual variable
> types".

u8 is NOT an unusual variable type at all.

thanks,

greg k-h

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

* Re: [PATCH v2] staging: rtl8723bs: convert swing index variables from u8 to int
  2026-09-01  9:43   ` Greg Kroah-Hartman
@ 2026-09-01 12:51     ` David Laight
  0 siblings, 0 replies; 3+ messages in thread
From: David Laight @ 2026-09-01 12:51 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Mohit Mishra, Dan Carpenter, Nikolay Kulikov, linux-staging,
	linux-kernel

On Tue, 1 Sep 2026 11:43:11 +0200
Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:

> On Tue, Aug 04, 2026 at 10:31:37PM +0530, Mohit Mishra wrote:
> > In ODM_TxPwrTrackSetPwr_8723B(), Final_OFDM_Swing_Index and
> > Final_CCK_Swing_Index are declared as u8. Using u8 for variables involved
> > in arithmetic calculations and lower-bound comparisons (<= 0) is unusual
> > and triggers static analysis warnings.  
> 
> What warnings?
> 
> > Convert both variables from u8 to int to clean up the variable types,
> > aligning with the TODO item to "convert any remaining unusual variable
> > types".  
> 
> u8 is NOT an unusual variable type at all.

Indeed, but doing arithmetic on u6 and u16 is likely to be less efficient
because the compiler has to mask the results (on pretty much all architectures
except x86 and m68k).
But that isn't the reason given.

David

> 
> thanks,
> 
> greg k-h
> 


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

end of thread, other threads:[~2026-09-01 12:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <YOUR-ORIGINAL-MESSAGE-ID>
2026-08-04 17:01 ` [PATCH v2] staging: rtl8723bs: convert swing index variables from u8 to int Mohit Mishra
2026-09-01  9:43   ` Greg Kroah-Hartman
2026-09-01 12:51     ` David Laight

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®