[PATCH 1/1] usb: avoid -Werror=address-of-packed-member

Marek Vasut marex at denx.de
Tue Dec 17 11:00:20 CET 2019


On 12/17/19 10:27 AM, Heinrich Schuchardt wrote:
> With GCC 9.2.1 errors of type -Werror=address-of-packed-member occur when
> passing a member of a packed structure to le16_to_cpus() on a big endian
> system (e.g. P2041RDB_defconfig).
> 
> Replace le16_to_cpus() by get_unaligned_le16(). Check defined(__BIG_ENDIAN)
> to avoid the introduction of unnecessary instructions on little endian
> systems as seen on aarch64.

I would expect the compiler would optimize such stuff out ?
Can we do without the ifdef ?

[...]


More information about the U-Boot mailing list