Re: [PATCH] staging: ks7010: Change capability field to __le16

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

 



On Thu, Apr 20, 2017 at 09:02:26PM +0200, Johan Svensson wrote:
> 
> On 2017-04-18 20:38, Greg KH wrote:
> > On Tue, Apr 18, 2017 at 08:24:01PM +0200, Johan Svensson wrote:
> >> Change capability field to __le16 in struct ap_info_t,
> >> struct link_ap_info_t, and struct local_ap_t.
> >> This fixes a sparse warning.
> > What warning is it fixing?  And are you sure this is the correct fix?
> > How did you test it?
> >
> > thanks,
> >
> > greg k-h
> Without the patch, sparse reports:
> drivers/staging/ks7010/ks_wlan_net.c:1459:24: warning: cast to restricted __le16
> 
> The capability field in the structs that are changed are already being treated as little endian i.e. the patch is correct if the le16_to_cpu conversion in ks_wlan_net.c:1459 is correct.

We have no guarantee that the above call to le16_to_cpu() is correct
(for example, this call would work correctly on little endian machines
regardless).

It may be safer to test endian code changes on hardware (at least with
this driver).

thanks,
Tobin.
_______________________________________________
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