linux/tools/usb/ffs-aio-example
Bhupesh Sharma c5edb757ba tools: usb: ffs-aio-example: Fix build error with aarch64-*-gnu-gcc toolchain(s)
The tools/usb/aio_simple.c file when cross-compiled with
aarch64-*-gnu-gcc toolchain(s) leads to the following errors:

  aio_simple.c:30:10: fatal error: endian.h: No such file or directory
  30 | #include <endian.h>
      |          ^~~~~~~~~~

  aio_simple.c:88:14: note: (near initialization for
                      'descriptors.fs_count')
  aio_simple.c:110:14: error: initializer element is not constant
  110 |  .hs_count = htole32(3),
      |              ^~~~~~~
  aio_simple.c:110:14: note: (near initialization for
                      'descriptors.hs_count')
  aio_simple.c:124:22: error: initializer element is not constant
  124 |    .wMaxPacketSize = htole16(512),
      |                      ^~~~~~~
  aio_simple.c:124:22: note: (near initialization for
                       'descriptors.hs_descs.bulk_sink.wMaxPacketSize')

Fix these compilation issues by:
 - Switching to _DEFAULT_SOURCE:
    _BSD_SOURCE is deprecated and gives a build warning. Let's use
    _DEFAULT_SOURCE instead.
 - Currently this file uses library htole16/32 function calls.
   Replace these with equivalent 'cpu_to_le16/32' calls.

Cc: Felipe Balbi <balbi@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Link: https://lore.kernel.org/r/20221029161312.171165-1-bhupesh.sharma@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-11-09 12:37:56 +01:00
..
multibuff License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
simple tools: usb: ffs-aio-example: Fix build error with aarch64-*-gnu-gcc toolchain(s) 2022-11-09 12:37:56 +01:00