[alsa-devel] [PATCH 1/7] ALSA: firewire-tascam: add skeleton for TASCAM FireWire series
Takashi Iwai
tiwai at suse.de
Sat Oct 3 10:51:29 CEST 2015
On Sat, 03 Oct 2015 04:34:24 +0200,
Takashi Sakamoto wrote:
>
> Hi,
>
> On Oct 13 2015 03:47, Clemens Ladisch wrote:
> > Takashi Iwai wrote:
> >> kbuild test robot wrote:
> >>>>> sound/firewire/tascam/tascam.c:23:16: sparse: cast to restricted __be32
> >>>
> >>> > 23 data = be32_to_cpu(fw_dev->config_rom[28]);
> >>
> >> The code itself looks correct. data is CPU endian.
> >> The problem looks rather like that fw_dev->config_rom[] is u32.
> >>
> >> Stefan, can it be changed to __be32 instead?
> >
> > config_rom[] is CPU endian, too.
> >
> > Strings should be read with fw_csr_string().
>
> The function is designed for IEEE 1212 compliant config ROM. On the
> other hand, config ROMs of these models are not fully compliant. See:
>
> http://sourceforge.net/p/linux1394/mailman/message/33899800/
>
> Currently, this driver supports just two models. These two models have
> similar structure in their config ROM, fortunately. Thus, it's
> reasonable for the driver to get information in hard-coded position of
> config ROM.
>
>
> 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. I selected the simplest way to pick it up.
>
> If it's preferrable to suppress the sparse warnings, I don't mind to
> replace these codes with the other ways.
Maybe introducing a macro would make things clearer. It's better than
open-coding at each place, in anyway.
Takashi
More information about the Alsa-devel
mailing list