Commit af20627c authored by Jaroslav Kysela's avatar Jaroslav Kysela

[ALSA] Fix the wrong sign of format data entries

PCM Midlevel
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 causes
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>
parent adfb4710
...@@ -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