diff options
author | Peter Senna Tschudin <peter.senna@gmail.com> | 2018-07-10 17:01:45 +0300 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2018-07-17 10:12:51 +0300 |
commit | a2b22dddc7bb6110ac3b5ed1a60aa9279836fadb (patch) | |
tree | d0f9846283d388b0b6fb0f9af168efe2b231fb22 /block/bfq-iosched.c | |
parent | bb2863369562b3f0320fc7d8a96a5cde4b50aaea (diff) | |
download | linux-a2b22dddc7bb6110ac3b5ed1a60aa9279836fadb.tar.xz |
tools: usb: ffs-test: Fix build on big endian systems
The tools/usb/ffs-test.c file defines cpu_to_le16/32 by using the C
library htole16/32 function calls. However, cpu_to_le16/32 are used when
initializing structures, i.e in a context where a function call is not
allowed.
It works fine on little endian systems because htole16/32 are defined by
the C library as no-ops. But on big-endian systems, they are actually
doing something, which might involve calling a function, causing build
failures, such as:
ffs-test.c:48:25: error: initializer element is not constant
#define cpu_to_le32(x) htole32(x)
^~~~~~~
ffs-test.c:128:12: note: in expansion of macro ‘cpu_to_le32’
.magic = cpu_to_le32(FUNCTIONFS_DESCRIPTORS_MAGIC_V2),
^~~~~~~~~~~
To solve this, we code cpu_to_le16/32 in a way that allows them to be
used when initializing structures. This fix was imported from
meta-openembedded/android-tools/fix-big-endian-build.patch written by
Thomas Petazzoni <thomas.petazzoni@free-electrons.com>.
CC: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'block/bfq-iosched.c')
0 files changed, 0 insertions, 0 deletions