Skip to contentSkip to conversation

OSS: fix operator precedence in return of btaudio_dsp_ioctl

PATCH? Roel Kluin 3 participants 3 messages Nov 29, 2007 Sound

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

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

---

sound/oss/btaudio.c +2 -1
index 4d5cf05..2a5cace 100644
@@ -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);
 		}
#1 lore raw
Quoted 2 lines · Roel Kluin

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 <[email protected]>

tom

#2 lore raw
Quoted 10 lines · Tomas Carnecky
Quoted 2 lines · Roel Kluin

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 <[email protected]>

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

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

Quoted 1 line

tom

cu
Adrian

Signature · 4 lines
       "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