lkml.org 
[lkml]   [2004]   [Dec]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] Fix Oops with ALSA OSS emulation on PPC (2.6.10-rc3)
Hi,

Ben finally found out the cause of Oops happening on ALSA OSS
emulation with powermac driver. It's because of the sign of char.

The patch is simple as attached below.
Could you apply it to 2.6.10?


thanks,

--
Takashi Iwai <tiwai@suse.de> ALSA Developer - www.alsa-project.org

====

Summary: [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: Takashi Iwai <tiwai@suse.de>


--- linux/sound/core/pcm_misc.c 8 Jun 2004 16:57:28 -0000 1.12
+++ linux/sound/core/pcm_misc.c 22 Dec 2004 18:07:29 -0000 1.14
@@ -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 */
};

-
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/

\
 
 \ /
  Last update: 2005-03-22 14:08    [W:0.405 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site