Skip to content

Commit

Permalink
ALSA: usb-audio: fix combine_word problem
Browse files Browse the repository at this point in the history
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.

	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.

	Probably, these defines should use get_unaligned_le16 and
friends.

Signed-off-by: Julian Anastasov <[email protected]>
Cc: <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
Julian Anastasov authored and tiwai committed Nov 7, 2009
1 parent 70edc80 commit f495088
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/usb/usbaudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down

0 comments on commit f495088

Please sign in to comment.