From: Andre Haupt <[email protected]>
Signed-off-by: Andre Haupt <[email protected]>
---
Index: linus/sound/oss/vidc.c
===================================================================
--- linus.orig/sound/oss/vidc.c 2007-08-30 11:57:13.000000000 +0200
+++ linus/sound/oss/vidc.c 2007-08-30 11:57:53.000000000 +0200
@@ -185,8 +185,6 @@ static unsigned int vidc_audio_set_forma
return vidc_audio_format;
}
-#define my_abs(i) ((i)<0 ? -(i) : (i))
-
static int vidc_audio_set_speed(int dev, int rate)
{
if (rate) {
@@ -214,8 +212,8 @@ static int vidc_audio_set_speed(int dev,
rate_ext = VIDC_SOUND_CLOCK_EXT / hwrate_ext;
/* Chose between external and internal clock */
- diff_int = my_abs(rate_ext-rate);
- diff_ext = my_abs(rate_int-rate);
+ diff_int = abs(rate_ext-rate);
+ diff_ext = abs(rate_int-rate);
if (diff_ext < diff_int) {
/*printk("VIDC: external %d %d %d\n", rate, rate_ext, hwrate_ext);*/
hwrate=hwrate_ext;
--
On Thu, Aug 30, 2007 at 12:40:38PM +0200, [email protected] wrote:
> - diff_int = my_abs(rate_ext-rate);
> - diff_ext = my_abs(rate_int-rate);
> + diff_int = abs(rate_ext-rate);
> + diff_ext = abs(rate_int-rate);
Nothing to do with the patch, but is this really correct? Surely it
should be diff_ext = abs(rate_ext-rate) ?
--
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
On Thu, Aug 30, 2007 at 05:17:47AM -0600, Matthew Wilcox wrote:
> On Thu, Aug 30, 2007 at 12:40:38PM +0200, [email protected] wrote:
> > - diff_int = my_abs(rate_ext-rate);
> > - diff_ext = my_abs(rate_int-rate);
> > + diff_int = abs(rate_ext-rate);
> > + diff_ext = abs(rate_int-rate);
>
> Nothing to do with the patch, but is this really correct? Surely it
> should be diff_ext = abs(rate_ext-rate) ?
hmmh, not sure about this ...
Russell?
regards,
Andre
On Thu, Aug 30, 2007 at 01:50:59PM +0200, Andre Haupt wrote:
> On Thu, Aug 30, 2007 at 05:17:47AM -0600, Matthew Wilcox wrote:
> > On Thu, Aug 30, 2007 at 12:40:38PM +0200, [email protected] wrote:
> > > - diff_int = my_abs(rate_ext-rate);
> > > - diff_ext = my_abs(rate_int-rate);
> > > + diff_int = abs(rate_ext-rate);
> > > + diff_ext = abs(rate_int-rate);
> >
> > Nothing to do with the patch, but is this really correct? Surely it
> > should be diff_ext = abs(rate_ext-rate) ?
>
> hmmh, not sure about this ...
No idea. The support for external clocking came from someone else
(I was never able to work it out myself).
I can only assume that the code as it stands does work. So let's
remain bug-compatible until there's a proven problem.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: