mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
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 <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
This commit is contained in:
parent
754813473c
commit
74c34ca1cc
8 changed files with 18 additions and 11 deletions
|
|
@ -1133,4 +1133,10 @@ int snd_pcm_add_chmap_ctls(struct snd_pcm *pcm, int stream,
|
|||
unsigned long private_value,
|
||||
struct snd_pcm_chmap **info_ret);
|
||||
|
||||
/* Strong-typed conversion of pcm_format to bitwise */
|
||||
static inline u64 pcm_format_to_bits(snd_pcm_format_t pcm_format)
|
||||
{
|
||||
return 1ULL << (__force int) pcm_format;
|
||||
}
|
||||
|
||||
#endif /* __SOUND_PCM_H */
|
||||
|
|
|
|||
Loading…
Reference in a new issue