[alsa-devel] [PATCH 1/7] ALSA: firewire-tascam: add skeleton for TASCAM FireWire series

Clemens Ladisch clemens at ladisch.de
Sat Oct 3 11:14:22 CEST 2015


Takashi Sakamoto wrote:
>>>> 23		data = be32_to_cpu(fw_dev->config_rom[28]);
>
> About using 'be32_to_cpu()', the 'config_rom' member actually has 'const
> u32 *', while in the member caracters in the textual leaf are aligned in
> big-endian.

Strictly speaking, strings do not have an endianness.

Most data in the actual configuration ROM is organized as big-endian 32-
bit values, so the FireWire core converts _all_ words from big endian to
CPU endian.  The words that are not actually 32-bit values but strings
have to be converted back; the correct function for this is cpu_to_be32().


Regards,
Clemens


More information about the Alsa-devel mailing list