public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH?] OSS: fix operator precedence in return of btaudio_dsp_ioctl
@ 2007-11-29 18:19 Roel Kluin
  2007-11-29 18:59 ` Tomas Carnecky
  0 siblings, 1 reply; 3+ messages in thread
From: Roel Kluin @ 2007-11-29 18:19 UTC (permalink / raw)
  To: lkml

First of all, is /sound/oss/* still maintained?

#define HWBASE_AD (448000)
...
with if(bta->analog) evaluating to true bta->decimation may range
from 15 to 5
...
HWBASE_AD*4/bta->decimation>>bta->sampleshift

which is equivalent to 

((HWBASE_AD * 4)/bta->decimation) >> bta->sampleshift

actually may evaluate to something like:

(1792000 / 15 ) >> bta->sampleshift

Isn't intended (HWBASE_AD * 4)/(bta->decimation >> bta->sampleshift)?
Then consider the patch below.
--
Fix operator precedence in return

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/sound/oss/btaudio.c b/sound/oss/btaudio.c
index 4d5cf05..2a5cace 100644
--- a/sound/oss/btaudio.c
+++ b/sound/oss/btaudio.c
@@ -661,7 +661,8 @@ static int btaudio_dsp_ioctl(struct inode *inode, struct file *file,
 		/* fall through */
         case SOUND_PCM_READ_RATE:
 		if (bta->analog) {
-			return put_user(HWBASE_AD*4/bta->decimation>>bta->sampleshift, p);
+			return put_user((HWBASE_AD * 4) /
+				(bta->decimation >> bta->sampleshift), p);
 		} else {
 			return put_user(bta->rate, p);
 		}

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH?] OSS: fix operator precedence in return of btaudio_dsp_ioctl
  2007-11-29 18:19 [PATCH?] OSS: fix operator precedence in return of btaudio_dsp_ioctl Roel Kluin
@ 2007-11-29 18:59 ` Tomas Carnecky
  2007-11-29 20:30   ` Adrian Bunk
  0 siblings, 1 reply; 3+ messages in thread
From: Tomas Carnecky @ 2007-11-29 18:59 UTC (permalink / raw)
  To: Roel Kluin; +Cc: lkml

Roel Kluin wrote:
> First of all, is /sound/oss/* still maintained?
> 

Documentation/feature-removal-schedule.txt

What:  drivers depending on OSS_OBSOLETE
When:  options in 2.6.23, code in 2.6.25
Why:   obsolete OSS drivers
Who:   Adrian Bunk <bunk@stusta.de>

tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH?] OSS: fix operator precedence in return of btaudio_dsp_ioctl
  2007-11-29 18:59 ` Tomas Carnecky
@ 2007-11-29 20:30   ` Adrian Bunk
  0 siblings, 0 replies; 3+ messages in thread
From: Adrian Bunk @ 2007-11-29 20:30 UTC (permalink / raw)
  To: Tomas Carnecky; +Cc: Roel Kluin, lkml

On Thu, Nov 29, 2007 at 07:59:26PM +0100, Tomas Carnecky wrote:
> Roel Kluin wrote:
> > First of all, is /sound/oss/* still maintained?
> > 
> 
> Documentation/feature-removal-schedule.txt
> 
> What:  drivers depending on OSS_OBSOLETE
> When:  options in 2.6.23, code in 2.6.25
> Why:   obsolete OSS drivers
> Who:   Adrian Bunk <bunk@stusta.de>

I'm maintaining only the gradual removal.  ;-)

That's only the removal of some of the remaining OSS drivers, but 
btaudio is among them.

> tom

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-11-29 20:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-29 18:19 [PATCH?] OSS: fix operator precedence in return of btaudio_dsp_ioctl Roel Kluin
2007-11-29 18:59 ` Tomas Carnecky
2007-11-29 20:30   ` Adrian Bunk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox