]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ALSA: pcm: Fix sparse warning wrt PCM format type
authorTakashi Iwai <tiwai@suse.de>
Wed, 25 Jul 2018 21:19:38 +0000 (23:19 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 27 Jul 2018 07:05:27 +0000 (09:05 +0200)
The PCM format type is with __bitwise, hence it needs the explicit
cast with __force.  It's ugly, but there is a reason for that cost...

This fixes the sparse warning:
  sound/core/oss/pcm_oss.c:1854:55: warning: incorrect type in argument 1 (different base types)

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/oss/pcm_oss.c

index 905a53c1cde5aeb8a82918d9b44dd0e92d765956..f8d4a419f3af957a2dd53ba8cf1673da607ec7e0 100644 (file)
@@ -1851,7 +1851,7 @@ static int snd_pcm_oss_get_formats(struct snd_pcm_oss_file *pcm_oss_file)
        format_mask = hw_param_mask_c(params, SNDRV_PCM_HW_PARAM_FORMAT);
        for (fmt = 0; fmt < 32; ++fmt) {
                if (snd_mask_test(format_mask, fmt)) {
-                       int f = snd_pcm_oss_format_to(fmt);
+                       int f = snd_pcm_oss_format_to((__force snd_pcm_format_t)fmt);
                        if (f >= 0)
                                formats |= f;
                }