Commit cf5bd50c authored by Takashi Iwai's avatar Takashi Iwai Committed by Linus Torvalds

[PATCH] alsa: fix oops with ALSA OSS emulation on PPC

Fix suggested by Benjamin Herrenschmidt <benh@kernel.crashing.org>

On architectures like PPC, char is handled as "unsigned char", thus the
pcm_format_data table entries with -1 give a positive 255.  This results
in Oops with OSS-emulation on such architectures.

The patch simply adds the right signed/unsigned prefix to fix this problem.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 87f3243f
...@@ -25,11 +25,14 @@ ...@@ -25,11 +25,14 @@
#include <sound/pcm.h> #include <sound/pcm.h>
#define SND_PCM_FORMAT_UNKNOWN (-1) #define SND_PCM_FORMAT_UNKNOWN (-1)
/* NOTE: "signed" prefix must be given below since the default char is
* unsigned on some architectures!
*/
struct pcm_format_data { struct pcm_format_data {
char width; /* bit width */ unsigned char width; /* bit width */
char phys; /* physical bit width */ unsigned char phys; /* physical bit width */
char le; /* 0 = big-endian, 1 = little-endian, -1 = others */ signed char le; /* 0 = big-endian, 1 = little-endian, -1 = others */
char signd; /* 0 = unsigned, 1 = signed, -1 = others */ signed char signd; /* 0 = unsigned, 1 = signed, -1 = others */
unsigned char silence[8]; /* silence data to fill */ unsigned char silence[8]; /* silence data to fill */
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment