Re: [BK PATCH] USB fixes for 2.6.10-rc3

Linus Torvalds
2004-12-10T00:08:43Z

On Thu, 9 Dec 2004, Greg KH wrote:
>
> No, the "fun" problem with this specific field (the wTotalLength one) is
> that we initially read them in from the hardware (which for USB is in le
> order) and then, in a later function, convert all of the le fields to
> native cpu order so that all device drivers don't have to worry about
> which fields in the usb structures are in which order.

Aargh.

> Yeah, it's not the cleanest, and yes, it is just shutting the warning
> up, but that's ok in this case. I guess I could look into doing the
> "two different structures" type thing again, if people don't like things
> like this in different places.

On the other hand, maybe you could just leave it in "hardware byte order".

That's something that sparse really can help with - it should pinpoint
exactly everybody who uses it, and give a reasonable error for them, so
that everybody can agree on the byte-order.

Oh, well..

Linus