ALSA: pcm_format_to_bits strong-typed conversion

Add a function to handle conversion from snd_pcm_format_t
to bitwise with proper typing.

Change such conversions to use this function and silence sparse
warnings.

Signed-off-by: Eldad Zack <eldad@fogrefinery.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Eldad Zack
2013-04-23 01:00:41 +02:00
committed by Takashi Iwai
parent 754813473c
commit 74c34ca1cc
8 changed files with 18 additions and 11 deletions

View File

@@ -966,7 +966,7 @@ static u64 snd_card_asihpi_playback_formats(struct snd_card_asihpi *asihpi,
if (!err)
err = hpi_outstream_query_format(h_stream, &hpi_format);
if (!err && (hpi_to_alsa_formats[format] != -1))
formats |= (1ULL << hpi_to_alsa_formats[format]);
formats |= pcm_format_to_bits(hpi_to_alsa_formats[format]);
}
return formats;
}
@@ -1142,7 +1142,7 @@ static u64 snd_card_asihpi_capture_formats(struct snd_card_asihpi *asihpi,
if (!err)
err = hpi_instream_query_format(h_stream, &hpi_format);
if (!err)
formats |= (1ULL << hpi_to_alsa_formats[format]);
formats |= pcm_format_to_bits(hpi_to_alsa_formats[format]);
}
return formats;
}