Commit 1d58e36ff8741e847d06fdc2fc1a27f313861944

Authored by Michal Nazarewicz
Committed by Greg Kroah-Hartman
1 parent 737c7943b8

tools: ffs-test: fix header values endianess

commit f35f71244da6e51db4e1f2c7e318581f498ececf upstream.

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.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

tools/usb/ffs-test.c
... ... @@ -116,8 +116,8 @@
116 116 .header = {
117 117 .magic = cpu_to_le32(FUNCTIONFS_DESCRIPTORS_MAGIC),
118 118 .length = cpu_to_le32(sizeof descriptors),
119   - .fs_count = 3,
120   - .hs_count = 3,
  119 + .fs_count = cpu_to_le32(3),
  120 + .hs_count = cpu_to_le32(3),
121 121 },
122 122 .fs_descs = {
123 123 .intf = {