All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH, for-next] ALSA: usb-audio: use FMTBITs in parse_audio_format_i
@ 2013-04-21 23:44 Eldad Zack
  2013-04-22  8:51 ` Takashi Iwai
  0 siblings, 1 reply; 8+ messages in thread
From: Eldad Zack @ 2013-04-21 23:44 UTC (permalink / raw)
  To: Takashi Iwai, Jaroslav Kysela, Daniel Mack, Clemens Ladisch
  Cc: alsa-devel, Eldad Zack

Replace the usage of SNDRV_PCM_FORMAT_* macros with the equivalent
SNDRV_PCM_FMTBIT_* macros, and the result be can assigned directly
to the formats field.
Modify the variable name to reflect the change.

The following sparse messages are silenced:

sound/usb/format.c:377:44: warning: incorrect type in assignment (different base types)
sound/usb/format.c:377:44:    expected int [signed] pcm_format
sound/usb/format.c:377:44:    got restricted snd_pcm_format_t [usertype] <noident>
sound/usb/format.c:379:44: warning: incorrect type in assignment (different base types)
sound/usb/format.c:379:44:    expected int [signed] pcm_format
sound/usb/format.c:379:44:    got restricted snd_pcm_format_t [usertype] <noident>
sound/usb/format.c:382:36: warning: incorrect type in assignment (different base types)
sound/usb/format.c:382:36:    expected int [signed] pcm_format
sound/usb/format.c:382:36:    got restricted snd_pcm_format_t [usertype] <noident>

Signed-off-by: Eldad Zack <eldad@fogrefinery.com>
---
 sound/usb/format.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/sound/usb/format.c b/sound/usb/format.c
index 020ede0..e025e28 100644
--- a/sound/usb/format.c
+++ b/sound/usb/format.c
@@ -365,7 +365,7 @@ static int parse_audio_format_i(struct snd_usb_audio *chip,
 {
 	struct usb_interface_descriptor *altsd = get_iface_desc(iface);
 	int protocol = altsd->bInterfaceProtocol;
-	int pcm_format, ret;
+	int pcm_formats, ret;
 
 	if (fmt->bFormatType == UAC_FORMAT_TYPE_III) {
 		/* FIXME: the format type is really IECxxx
@@ -377,14 +377,14 @@ static int parse_audio_format_i(struct snd_usb_audio *chip,
 		case USB_ID(0x0763, 0x2003): /* M-Audio Audiophile USB */
 			if (chip->setup == 0x00 && 
 			    fp->altsetting == 6)
-				pcm_format = SNDRV_PCM_FORMAT_S16_BE;
+				pcm_formats = SNDRV_PCM_FMTBIT_S16_BE;
 			else
-				pcm_format = SNDRV_PCM_FORMAT_S16_LE;
+				pcm_formats = SNDRV_PCM_FMTBIT_S16_LE;
 			break;
 		default:
-			pcm_format = SNDRV_PCM_FORMAT_S16_LE;
+			pcm_formats = SNDRV_PCM_FMTBIT_S16_LE;
 		}
-		fp->formats = 1uLL << pcm_format;
+		fp->formats = pcm_formats;
 	} else {
 		fp->formats = parse_audio_format_i_type(chip, fp, format,
 							fmt, protocol);
-- 
1.8.1.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-04-22 23:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-21 23:44 [PATCH, for-next] ALSA: usb-audio: use FMTBITs in parse_audio_format_i Eldad Zack
2013-04-22  8:51 ` Takashi Iwai
2013-04-22 11:29   ` Eldad Zack
2013-04-22 11:34     ` Takashi Iwai
2013-04-22 11:47       ` Eldad Zack
2013-04-22 11:49         ` Takashi Iwai
2013-04-22 23:00           ` [PATCH, for-next 1/2] ALSA: pcm_format_to_bits strong-typed conversion Eldad Zack
2013-04-22 23:00             ` [PATCH, for-next 2/2] ALSA: asihpi: add format support check in snd_card_asihpi_capture_formats Eldad Zack

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.