Re: [PATCH] staging:rtl8723au: Fix sparse warning cast to restricted __le16

2014-11-17 Thread Tobenna Peter, Igwe
On Mon, Nov 17, 2014 at 05:59:47PM -0800, Greg KH wrote:
 On Tue, Nov 18, 2014 at 01:45:41AM +, Tobenna P. Igwe wrote:
  This patch fixes the following sparse warning:
  
  drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c:343:36: warning:
  cast to restricted __le16
  
  by using the le16_to_cpus function.
  
  Signed-off-by: Tobenna P. Igwe pti...@gmail.com
  ---
   drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c |2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
  
  diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c 
  b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
  index d80ea4e..78665ee 100644
  --- a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
  +++ b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
  @@ -340,7 +340,7 @@ static u8 bthci_GetAssocInfo(struct rtw_adapter 
  *padapter, u8 EntryNum)
  tempBuf, TotalLen-BaseMemoryShift);
   
  pAmpAsoc = (struct amp_assoc_structure *)tempBuf;
  -   pAmpAsoc-Length = le16_to_cpu(pAmpAsoc-Length);
  +   le16_to_cpus(pAmpAsoc-Length);
 
 This doesn't change the logic, and you should still have the same
 warning.  How about fixing up Length to be the proper endian type?
 
 thanks,
 
 greg k-h

I've checked and sparse doesn't return the warning anymore. Also, I
backtracked through the file and Length seems to be set to its
correct endian type. The reason for the conversion is tempBuf being
an array of 'u8'.

Kind Regards,
Tobenna P. Igwe
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging:rtl8723au: Fix sparse warning cast to restricted __le16

2014-11-17 Thread Greg KH
On Tue, Nov 18, 2014 at 02:51:45AM +, Tobenna Peter, Igwe wrote:
 On Mon, Nov 17, 2014 at 05:59:47PM -0800, Greg KH wrote:
  On Tue, Nov 18, 2014 at 01:45:41AM +, Tobenna P. Igwe wrote:
   This patch fixes the following sparse warning:
   
   drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c:343:36: warning:
   cast to restricted __le16
   
   by using the le16_to_cpus function.
   
   Signed-off-by: Tobenna P. Igwe pti...@gmail.com
   ---
drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
   
   diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c 
   b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
   index d80ea4e..78665ee 100644
   --- a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
   +++ b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
   @@ -340,7 +340,7 @@ static u8 bthci_GetAssocInfo(struct rtw_adapter 
   *padapter, u8 EntryNum)
 tempBuf, TotalLen-BaseMemoryShift);

 pAmpAsoc = (struct amp_assoc_structure *)tempBuf;
   - pAmpAsoc-Length = le16_to_cpu(pAmpAsoc-Length);
   + le16_to_cpus(pAmpAsoc-Length);
  
  This doesn't change the logic, and you should still have the same
  warning.  How about fixing up Length to be the proper endian type?
  
  thanks,
  
  greg k-h
 
 I've checked and sparse doesn't return the warning anymore. Also, I
 backtracked through the file and Length seems to be set to its
 correct endian type. The reason for the conversion is tempBuf being
 an array of 'u8'.

Ah, that makes sense, ok, I'll queue this up in a few days when I get a
chance.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel