staging: rtl8723au: Fix sparse warning: cast to restricted __le16
PATCH 1/1 staging: rtl8723au: Fix sparse warning: cast to restricted __le16
usPtr is used as __le16 *, but was defined as u16 *.
This was reported by sparse as:drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c:1850:29: warning: cast to restricted __le16
This patch fixes the type of usPtr.
--- drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c +1 -1
@@ -1838,7 +1838,7 @@ Hal_EfuseParseThermalMeter_8723A(struct rtw_adapter *padapter,static void rtl8723a_cal_txdesc_chksum (struct tx_desc *ptxdesc) { -u16 *usPtr = (u16 *) ptxdesc; +__le16 *usPtr = (__le16 *)ptxdesc;u32 count =16 ;/* (32 bytes / 2 bytes per XOR) => 16 times */ u32 index;u16 checksum =0 ;
Signature · 1 line
2.5.0
Quoted 11 lines · Johannes Postma
usPtr is used as
__le16*, but was defined as u16 *.
This was reported by sparse as:drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c:1850:29: warning: cast to restricted__le16This patch fixes the type of usPtr.
Signed-off-by Johannes Postma <[email protected]>--- drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Looks OK to me. Probably worth changing the *(usPtr + index) to be usPtr[index] as well to make the code easier to read.
Jes
Quoted 13 lines
drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c +1
-1@@ -1838,7 +1838,7 @@ Hal_EfuseParseThermalMeter_8723A(struct rtw_adapter *padapter,static void rtl8723a_cal_txdesc_chksum (struct tx_desc *ptxdesc) { -u16 *usPtr = (u16 *) ptxdesc; +__le16 *usPtr = (__le16 *)ptxdesc;u32 count =16 ;/* (32 bytes / 2 bytes per XOR) => 16 times */ u32 index;u16 checksum =0 ;
Quoted 6 lines · Jes Sorensen
Looks OK to me. Probably worth changing the *(usPtr + index) to be usPtr[index] as well to make the code easier to read.
Jes
Thank you for reviewing. I will make a seperate patch for that. I will send it after this one is accepted. Or should I combine them into a patch serie?
Johannes
Quoted 11 lines · Johannes Postma
Quoted 6 lines · Jes Sorensen
Looks OK to me. Probably worth changing the *(usPtr + index) to be usPtr[index] as well to make the code easier to read.
Jes
Thank you for reviewing. I will make a seperate patch for that. I will send it after this one is accepted. Or should I combine them into a patch serie?
Either is fine with me.
Jes
Quoted 9 lines · Jes Sorensen
Quoted 8 lines · Johannes Postma
Quoted 6 lines · Jes Sorensen
Looks OK to me. Probably worth changing the *(usPtr + index) to be usPtr[index] as well to make the code easier to read.
Jes
Quoted 7 lines
Quoted 3 lines
Thank you for reviewing. I will make a seperate patch for that. I will send it after this one is accepted. Or should I combine them into a patch serie?
Either is fine with me.
Jes
Ok, I have sent it as a separate patch. Since it doesn't depend on this patch and should apply cleanly I have already sent it in.
Johannes