Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f6072896e3f4c577db7e3a06105ebdfd52d7e7c9
Commit:     f6072896e3f4c577db7e3a06105ebdfd52d7e7c9
Parent:     f987fc880d191bf2ef66ac17e9d524aee6afa02e
Author:     Takashi YOSHII <[EMAIL PROTECTED]>
AuthorDate: Mon Mar 12 15:33:22 2007 +0900
Committer:  Paul Mundt <[EMAIL PROTECTED]>
CommitDate: Mon May 7 02:10:53 2007 +0000

    sh: heartbeat double 0 fix.
    
    This implements stricter and more compliant knightrider strobing in the
    heartbeat handler. While there still seems to be some debate as to
    whether the double 0 is "more" correct or not, this updated version
    appears to have general consensus. Fixes a long-term "bug".
    
    Signed-off-by: Takashi YOSHII <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mundt <[EMAIL PROTECTED]>
---
 arch/sh/drivers/heartbeat.c |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/arch/sh/drivers/heartbeat.c b/arch/sh/drivers/heartbeat.c
index bc59cb6..23dd608 100644
--- a/arch/sh/drivers/heartbeat.c
+++ b/arch/sh/drivers/heartbeat.c
@@ -40,16 +40,9 @@ static void heartbeat_timer(unsigned long data)
        static unsigned bit = 0, up = 1;
 
        ctrl_outw(1 << hd->bit_pos[bit], (unsigned long)hd->base);
-       if (up)
-               if (bit == (ARRAY_SIZE(hd->bit_pos) - 1)) {
-                       bit--;
-                       up = 0;
-               } else
-                       bit++;
-       else if (bit == 0)
-               up = 1;
-       else
-               bit--;
+       bit += up;
+       if ((bit == 0) || (bit == ARRAY_SIZE(hd->bit_pos)-1))
+               up = -up;
 
        mod_timer(&hd->timer, jiffies + (110 - ((300 << FSHIFT) /
                        ((avenrun[0] / 5) + (3 << FSHIFT)))));
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to