[alsa-devel] [PATCH] ALSA: dice: improve support for ancient firmware for DICE
Takashi Iwai
tiwai at suse.de
Tue Apr 24 13:49:15 CEST 2018
On Sun, 22 Apr 2018 20:25:36 +0200,
kbuild test robot wrote:
>
> sparse warnings: (new ones prefixed by >>)
>
> >> sound/firewire/dice/dice-transaction.c:334:21: sparse: restricted __be32 degrades to integer
> sound/firewire/dice/dice-transaction.c:336:21: sparse: restricted __be32 degrades to integer
>
> vim +334 sound/firewire/dice/dice-transaction.c
(snip)
> 333 /* Old firmware doesn't support these fields. */
> > 334 if (pointers[7] > 0)
> 335 dice->sync_offset = be32_to_cpu(pointers[6]) * 4;
> 336 if (pointers[9] > 0)
> 337 dice->rsrv_offset = be32_to_cpu(pointers[8]) * 4;
The warning looks reasonable.
Alternatively, you can rewrite it as a non-zero check:
if (pointers[7])
....
Then it would be OK without endian conversion.
thanks,
Takashi
More information about the Alsa-devel
mailing list