Re: [PATCH] joydev: fix HZ->millisecond transformation

From: Vojtech Pavlik (vojtech@suse.cz)
Date: Fri Dec 20 2002 - 08:24:43 EST


On Fri, Dec 20, 2002 at 02:41:50AM -0800, george anzinger wrote:
> Bjorn Helgaas wrote:
> >
> > * fix a problem with HZ->millisecond transformation on
> > non-x86 archs (from 2.5 change by vojtech@suse.cz)
> >
> > Applies to 2.4.20.
> >
> > diff -Nru a/drivers/input/joydev.c b/drivers/input/joydev.c
> > --- a/drivers/input/joydev.c Mon Dec 16 12:16:32 2002
> > +++ b/drivers/input/joydev.c Mon Dec 16 12:16:32 2002
> > @@ -50,6 +50,8 @@
> > #define JOYDEV_MINORS 32
> > #define JOYDEV_BUFFER_SIZE 64
> >
> > +#define MSECS(t) (1000 * ((t) / HZ) + 1000 * ((t) % HZ) / HZ)
> Uh...
> ^^^^^^^^^^^^^^^^
> by definition this is zero, is it not?

No, both parts of the equaition can be nonzero.

Though it might be easier to say (1000 * t) / HZ, now that I think about
it.

-- 
Vojtech Pavlik
SuSE Labs
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Dec 23 2002 - 22:00:26 EST