All of lore.kernel.org
 help / color / mirror / Atom feed
From: george anzinger <george@mvista.com>
To: Bjorn Helgaas <bjorn_helgaas@hp.com>
Cc: Marcelo Tosatti <marcelo@conectiva.com.br>,
	vojtech@ucw.cz, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] joydev: fix HZ->millisecond transformation
Date: Fri, 20 Dec 2002 02:41:50 -0800	[thread overview]
Message-ID: <3E02F3EE.C1367073@mvista.com> (raw)
In-Reply-To: 200212161227.38764.bjorn_helgaas@hp.com

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?

> +
>  struct joydev {
>         int exist;
>         int open;
> @@ -134,7 +136,7 @@
>                         return;
>         }
> 
> -       event.time = jiffies * (1000 / HZ);
> +       event.time = MSECS(jiffies);
> 
>         while (list) {
> 
> @@ -279,7 +281,7 @@
> 
>                 struct js_event event;
> 
> -               event.time = jiffies * (1000/HZ);
> +               event.time = MSECS(jiffies);
> 
>                 if (list->startup < joydev->nkey) {
>                         event.type = JS_EVENT_BUTTON | JS_EVENT_INIT;
> 
> -
> 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/

-- 
George Anzinger   george@mvista.com
High-res-timers: 
http://sourceforge.net/projects/high-res-timers/
Preemption patch:
http://www.kernel.org/pub/linux/kernel/people/rml

  reply	other threads:[~2002-12-20 10:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-16 19:27 [PATCH] joydev: fix HZ->millisecond transformation Bjorn Helgaas
2002-12-20 10:41 ` george anzinger [this message]
2002-12-20 13:24   ` Vojtech Pavlik
2002-12-20 14:52     ` Joe Korty
2002-12-20 17:24     ` george anzinger
2002-12-20 17:35       ` Vojtech Pavlik
2002-12-20 18:16         ` george anzinger
2002-12-21  9:18           ` Vojtech Pavlik
2002-12-21 16:46             ` george anzinger

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=3E02F3EE.C1367073@mvista.com \
    --to=george@mvista.com \
    --cc=bjorn_helgaas@hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    --cc=vojtech@ucw.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.