ALSA: dice: correct variable types for __be32 data
Some local variables in some functions are typed as unsigned int, while __be32 value is assigned to them. This causes sparse warnings. dice-stream.c:50:17: warning: incorrect type in assignment (different base types) dice-stream.c:50:17: expected unsigned int [unsigned] channel dice-stream.c:50:17: got restricted __be32 [usertype] <noident> dice-stream.c:74:17: warning: incorrect type in assignment (different base types) dice-stream.c:74:17: expected unsigned int [unsigned] channel dice-stream.c:74:17: got restricted __be32 [usertype] <noident> This commit fixes this bug. Fixes: 288a8d0cb04f('ALSA: dice: Change the way to start stream') Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
ad4401e53d
commit
3e93d42a04
|
@ -44,16 +44,16 @@ int snd_dice_stream_get_rate_mode(struct snd_dice *dice, unsigned int rate,
|
||||||
static void release_resources(struct snd_dice *dice,
|
static void release_resources(struct snd_dice *dice,
|
||||||
struct fw_iso_resources *resources)
|
struct fw_iso_resources *resources)
|
||||||
{
|
{
|
||||||
unsigned int channel;
|
__be32 channel;
|
||||||
|
|
||||||
/* Reset channel number */
|
/* Reset channel number */
|
||||||
channel = cpu_to_be32((u32)-1);
|
channel = cpu_to_be32((u32)-1);
|
||||||
if (resources == &dice->tx_resources)
|
if (resources == &dice->tx_resources)
|
||||||
snd_dice_transaction_write_tx(dice, TX_ISOCHRONOUS,
|
snd_dice_transaction_write_tx(dice, TX_ISOCHRONOUS,
|
||||||
&channel, 4);
|
&channel, sizeof(channel));
|
||||||
else
|
else
|
||||||
snd_dice_transaction_write_rx(dice, RX_ISOCHRONOUS,
|
snd_dice_transaction_write_rx(dice, RX_ISOCHRONOUS,
|
||||||
&channel, 4);
|
&channel, sizeof(channel));
|
||||||
|
|
||||||
fw_iso_resources_free(resources);
|
fw_iso_resources_free(resources);
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ static int keep_resources(struct snd_dice *dice,
|
||||||
struct fw_iso_resources *resources,
|
struct fw_iso_resources *resources,
|
||||||
unsigned int max_payload_bytes)
|
unsigned int max_payload_bytes)
|
||||||
{
|
{
|
||||||
unsigned int channel;
|
__be32 channel;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
err = fw_iso_resources_allocate(resources, max_payload_bytes,
|
err = fw_iso_resources_allocate(resources, max_payload_bytes,
|
||||||
|
@ -74,10 +74,10 @@ static int keep_resources(struct snd_dice *dice,
|
||||||
channel = cpu_to_be32(resources->channel);
|
channel = cpu_to_be32(resources->channel);
|
||||||
if (resources == &dice->tx_resources)
|
if (resources == &dice->tx_resources)
|
||||||
err = snd_dice_transaction_write_tx(dice, TX_ISOCHRONOUS,
|
err = snd_dice_transaction_write_tx(dice, TX_ISOCHRONOUS,
|
||||||
&channel, 4);
|
&channel, sizeof(channel));
|
||||||
else
|
else
|
||||||
err = snd_dice_transaction_write_rx(dice, RX_ISOCHRONOUS,
|
err = snd_dice_transaction_write_rx(dice, RX_ISOCHRONOUS,
|
||||||
&channel, 4);
|
&channel, sizeof(channel));
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
release_resources(dice, resources);
|
release_resources(dice, resources);
|
||||||
end:
|
end:
|
||||||
|
|
Loading…
Reference in New Issue