Re: [PATCH] staging: rtl8723au: type casting corrections

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Greg KH <greg@xxxxxxxxx> writes:
> On Sun, Aug 17, 2014 at 10:19:28AM -0300, Raphael Silva wrote:
>>  Type casting corrections in order to solve warnings of the sparce static analyser.
>> 
>> Signed-off-by: Raphael Silva <rapphil@xxxxxxxxx>
>> ---
>>  drivers/staging/rtl8723au/hal/usb_halinit.c       | 4 ++--
>>  drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 2 +-
>>  2 files changed, 3 insertions(+), 3 deletions(-)
>> 
>> diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c b/drivers/staging/rtl8723au/hal/usb_halinit.c
>> index b49bf33..969e4f3 100644
>> --- a/drivers/staging/rtl8723au/hal/usb_halinit.c
>> +++ b/drivers/staging/rtl8723au/hal/usb_halinit.c
>> @@ -1228,9 +1228,9 @@ static void Hal_EfuseParsePIDVID_8723AU(struct rtw_adapter *pAdapter,
>>  	} else {
>>  		/*  VID, PID */
>>  		pHalData->EEPROMVID =
>> -			le16_to_cpu(*(u16 *)&hwinfo[EEPROM_VID_8723AU]);
>> +			le16_to_cpu(*(__le16 *)&hwinfo[EEPROM_VID_8723AU]);
>
> Shouldn't the structure bt of type __le16 so that there is no warning
> here?

We can't really make it an array of __le16 as it's the content of the
EEPROM and it contains various different elements. To get it right, it
would require defining it as a struct and declaring the various elements
correctly within the struct.

However we could get rid of this portion completely since
pHalData->EEPROM[PV]ID aren't used for anything in the code, besides
printing the values in debug mode.

Cheers,
Jes
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux