Re: [PATCH] ALSA: dice: improve support for ancient firmware for DICE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux