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

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

 



On Mon, Apr 24, 2017 at 08:44:38PM +1000, Tobin C. Harding wrote:
> 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).

This statement is incorrect, my apologies.

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

I cannot get a proper handle on the endianness in ks7010 yet, perhaps
someone more experienced would not find it so difficult. It seems
there are some anomalies in the way this driver handles byte order.

I still maintain that hardware testing is needed to resolve these issues.

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