public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: torvalds@osdl.org
Cc: akpm@osdl.org, perex@suse.cz, benh@kernel.crashing.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] Fix Oops with ALSA OSS emulation on PPC (2.6.10-rc3)
Date: Wed, 22 Dec 2004 19:35:22 +0100	[thread overview]
Message-ID: <s5hllbqqiz9.wl@alsa2.suse.de> (raw)

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 */
 };
 


                 reply	other threads:[~2004-12-22 18:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hllbqqiz9.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=akpm@osdl.org \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@suse.cz \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox