diff options
author | Jaroslav Kysela <perex@suse.cz> | 2005-01-03 13:29:35 +0100 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2005-01-03 13:29:35 +0100 |
commit | af20627c8db8f0b1b45599ff0d69be30af7db576 (patch) | |
tree | 52a36e5cd953ccbd12798cbf281ff24aca93af1b /sound | |
parent | adfb4710942a919b9345521d5e6244a6cffadccb (diff) | |
download | history-af20627c8db8f0b1b45599ff0d69be30af7db576.tar.gz |
[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: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/core/pcm_misc.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sound/core/pcm_misc.c b/sound/core/pcm_misc.c index 794372b6df66f0..422b8db141547f 100644 --- a/sound/core/pcm_misc.c +++ b/sound/core/pcm_misc.c @@ -25,11 +25,14 @@ #include <sound/pcm.h> #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 { - char width; /* bit width */ - char phys; /* physical bit width */ - char le; /* 0 = big-endian, 1 = little-endian, -1 = others */ - char signd; /* 0 = unsigned, 1 = signed, -1 = others */ + unsigned char width; /* bit width */ + unsigned char phys; /* physical bit width */ + signed char le; /* 0 = big-endian, 1 = little-endian, -1 = others */ + signed char signd; /* 0 = unsigned, 1 = signed, -1 = others */ unsigned char silence[8]; /* silence data to fill */ }; |