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

From: Greg KH
Date: Thu Dec 09 2004 - 18:58:30 EST


On Thu, Dec 09, 2004 at 03:41:47PM -0800, Linus Torvalds wrote:
>
>
> On Thu, 9 Dec 2004, Greg KH wrote:
> >
> > Greg Kroah-Hartman:
> > o USB: fix another sparse warning in the USB core
>
> This one looks incorrect.
>
> The code doesn't _fix_ any warnings. It just shuts them up, without fixing
> anything at all.

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.

I tried a while ago to create 2 different versions of the structures,
one in the "on the wire" format, and the other after we had converted
them to native format, but it just got too messy for no real good
reason. I then just put the proper __force markings in the needed
places within the USB core. Here's just a place where I had missed it
before for some reason.

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.

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/