Skip to content

Commit

Permalink
tools: ffs-test: fix header values endianess
Browse files Browse the repository at this point in the history
It appears that no one ever run ffs-test on a big-endian machine,
since it used cpu-endianess for fs_count and hs_count fields which
should be in little-endian format.  Fix by wrapping the numbers in
cpu_to_le32.

Cc: stable@vger.kernel.org
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
mina86 authored and Felipe Balbi committed Jun 30, 2014
1 parent 508ccea commit f35f712
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/usb/ffs-test.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ static const struct {
.header = { .header = {
.magic = cpu_to_le32(FUNCTIONFS_DESCRIPTORS_MAGIC), .magic = cpu_to_le32(FUNCTIONFS_DESCRIPTORS_MAGIC),
.length = cpu_to_le32(sizeof descriptors), .length = cpu_to_le32(sizeof descriptors),
.fs_count = 3, .fs_count = cpu_to_le32(3),
.hs_count = 3, .hs_count = cpu_to_le32(3),
}, },
.fs_descs = { .fs_descs = {
.intf = { .intf = {
Expand Down

0 comments on commit f35f712

Please sign in to comment.