All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: "debian-powerpc@lists.debian.org" <debian-powerpc@lists.debian.org>
Cc: linuxppc-dev list <linuxppc-dev@ozlabs.org>
Subject: Re: [PATCH] Fix Alsa issues including Oopses with OSS emulation
Date: Wed, 22 Dec 2004 19:35:13 +0100	[thread overview]
Message-ID: <1103740513.29974.0.camel@gaston> (raw)
In-Reply-To: <1103739194.5316.1.camel@gaston>

On Wed, 2004-12-22 at 19:13 +0100, Benjamin Herrenschmidt wrote:
> This patch (which will be send upstream separately by the Alsa folks) fixes
> an signed vs. unsigned char problem in Alsa which was the cause of the Oops
> people were experiencing on ppc with OSS emulation and possibly other issues.

Ok, actually, the one that will be commited upstream is a bit different,
here it is:


Summary: [ALSA] Fix the wrong sign of format data entries

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>


--- 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: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-22 18:13 [PATCH] Fix Alsa issues including Oopses with OSS emulation Benjamin Herrenschmidt
2004-12-22 18:35 ` Benjamin Herrenschmidt [this message]
2004-12-23  6:25   ` Sven Luther
2004-12-23  6:55     ` Benjamin Herrenschmidt
2004-12-23 11:36       ` Sven Luther
2004-12-26 12:05   ` Sven Luther
2004-12-22 23:36 ` Martin-Éric Racine
2004-12-23  0:15   ` Dean Hamstead
2004-12-23  8:00     ` Benjamin Herrenschmidt
2004-12-23 12:25       ` Dean Hamstead
2004-12-23 14:03         ` Benjamin Herrenschmidt
2004-12-23  6:54   ` Benjamin Herrenschmidt

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=1103740513.29974.0.camel@gaston \
    --to=benh@kernel.crashing.org \
    --cc=debian-powerpc@lists.debian.org \
    --cc=linuxppc-dev@ozlabs.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.