Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751320AbZKGJWm (ORCPT ); Sat, 7 Nov 2009 04:22:42 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751253AbZKGJWl (ORCPT ); Sat, 7 Nov 2009 04:22:41 -0500 Received: from cantor2.suse.de ([195.135.220.15]:35262 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751248AbZKGJWk (ORCPT ); Sat, 7 Nov 2009 04:22:40 -0500 Date: Sat, 07 Nov 2009 10:22:45 +0100 Message-ID: From: Takashi Iwai To: Julian Anastasov Cc: linux-kernel Subject: Re: [PATCH] usb-audio: fix combine_word problem In-Reply-To: References: User-Agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.7 Emacs/23.1 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1827 Lines: 54 At Fri, 6 Nov 2009 23:44:53 +0200 (EET), Julian Anastasov wrote: > > > Fix combine_word problem where first octet is not > read properly. The only affected place seems to be the > INPUT_TERMINAL type. Before now, sound controls can be created > with the output terminal's name which is a fallback mechanism > used only for unknown input terminal types. For example, > Line can wrongly appear as Speaker. After the change it > should appear as Line. Wow, this is really an old bug. I wonder no one noticed it, so far... > The side effect of this change can be that users > can expect the wrong control name in their scripts or > programs while now we return the correct one. Yes, but it's a right "fix", so let it be. > Probably, these defines should use get_unaligned_le16 and > friends. Sounds like a good idea. But 24bit version is still missing :) > Signed-off-by: Julian Anastasov Applied now, and added Cc to stable kernel. Thanks! Takashi > --- > > diff -urp v2.6.31/linux/sound/usb/usbaudio.h linux/sound/usb/usbaudio.h > --- v2.6.31/linux/sound/usb/usbaudio.h 2009-06-13 10:53:59.000000000 +0300 > +++ linux/sound/usb/usbaudio.h 2009-11-06 22:38:00.000000000 +0200 > @@ -210,7 +210,7 @@ struct snd_usb_midi_endpoint_info { > /* > */ > > -#define combine_word(s) ((*s) | ((unsigned int)(s)[1] << 8)) > +#define combine_word(s) ((*(s)) | ((unsigned int)(s)[1] << 8)) > #define combine_triple(s) (combine_word(s) | ((unsigned int)(s)[2] << 16)) > #define combine_quad(s) (combine_triple(s) | ((unsigned int)(s)[3] << 24)) > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/