USB: io_ti: fix firmware download on big-endian machines (part 2)
authorJohan Hovold <jhovold@gmail.com>
Sat, 26 Apr 2014 09:53:44 +0000 (11:53 +0200)
committerJiri Slaby <jslaby@suse.cz>
Fri, 20 Jun 2014 15:34:10 +0000 (17:34 +0200)
commit130f4c5a1899ca488a2c501311d9f5a746330f32
treee33e6fb98ac6f9952349c78ca3ebae85d394ff8d
parentc3300d7c625c606c7619e1eac14a985a48ff40bf
USB: io_ti: fix firmware download on big-endian machines (part 2)

commit c03890ff5e24a4bf59059f2d179f427559b7330a upstream.

A recent patch that purported to fix firmware download on big-endian
machines failed to add the corresponding sparse annotation to the
i2c-header. This was reported by the kbuild test robot.

Adding the appropriate annotation revealed another endianess bug related
to the i2c-header Size-field in a code path that is exercised when the
firmware is actually being downloaded (and not just verified and left
untouched unless older than the firmware at hand).

This patch adds the required sparse annotation to the i2c-header and
makes sure that the Size-field is sent in little-endian byte order
during firmware download also on big-endian machines.

Note that this patch is only compile-tested, but that there is no
functional change for little-endian systems.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Cc: Ludovic Drolez <ldrolez@debian.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/usb/serial/io_ti.c
drivers/usb/serial/io_usbvend.h