mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@samba.org>
To: <alex.buell@tahallah.demon.co.uk>
Cc: "David S. Miller" <davem@redhat.com>, <linux-kernel@vger.kernel.org>
Subject: Re: [sparc] Weird ioctl() bug in 2.2.19 (fwd)
Date: Thu, 1 Nov 2001 14:52:51 +1100 (EST)	[thread overview]
Message-ID: <15328.50963.299395.630022@cargo.ozlabs.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.33.0110311958040.20237-100000@tahallah.demon.co.uk>
In-Reply-To: <20011031.103241.45747017.davem@redhat.com> <Pine.LNX.4.33.0110311958040.20237-100000@tahallah.demon.co.uk>

Alex Buell writes:

> No, the ioctl numbers are correct, it's ESD that's fscked.
> 
>     /* set the sound driver audio format for playback */
> #if defined(__powerpc__)
>     value = test = ( (esd_audio_format & ESD_MASK_BITS) == ESD_BITS16 )
>         ? /* 16 bit */ AFMT_S16_NE : /* 8 bit */ AFMT_U8;
> #else /* #if !defined(__powerpc__) */
>     value = test = ( (esd_audio_format & ESD_MASK_BITS) == ESD_BITS16 )
>         ? /* 16 bit */ AFMT_S16_LE : /* 8 bit */ AFMT_U8;
> #endif /* #if !defined(__powerpc__) */
> 
> <sarcasm>
> This is such a lovely piece of code!
> <sarcasm>

Indeed...

> Anyway, I can fix it now by adding the appropriate AFMT_S16_BE statement
> guarded by a #ifdef but this sucks. Thanks to Peter Jones who spotted this
> one.

Why can't you just use AFMT_S16_NE on all platforms?  That is supposed
to be equal to AFMT_S16_BE on big-endian platforms and to AFMT_S16_LE
on little-endian platforms.  NE == native endian.

Paul.

  parent reply	other threads:[~2001-11-01  3:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-31 10:41 Alex Buell
2001-10-31 17:29 ` David S. Miller
2001-10-31 18:28   ` Alex Buell
2001-10-31 18:32   ` David S. Miller
2001-10-31 20:00     ` Alex Buell
2001-11-01  3:52     ` Paul Mackerras [this message]
2001-11-01 13:19       ` Alex Buell
2001-11-01 16:00         ` Peter Jones
2001-11-01 16:21           ` Alex Buell
2001-11-01 16:27             ` Peter Jones
2001-11-01 19:28               ` Alex Buell

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=15328.50963.299395.630022@cargo.ozlabs.ibm.com \
    --to=paulus@samba.org \
    --cc=alex.buell@tahallah.demon.co.uk \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®