lkml.org 
[lkml]   [2000]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    SubjectRe: patch: delay_50ms() in ide-probe.c in 2.2.14
    Date
    arijort@valinux.com writes:
    > Simple arithmetic tells me this patch
    >
    > a) produces same behavior as previous code, and
    > b) does it with fewer calculations.
    >
    > So it has to be good, right?
    > But then how do we exit the while loop?
    > How does jiffies change?
    >
    > This patch applies cleanly against 2.2.14
    > Against 2.3.45, the relevant file is ide.c
    > but otherwise, it's clean.

    It's also wrong. (HZ + 39)/20 is constant, and you therefore have
    effectively a while(1); loop there now.

    (Hint: 'jiffies' is updated in an interrupt routine which is enabled
    throughout this function).

    > --- drivers/block/ide-probe.c.orig Sun Feb 20 00:46:54 2000
    > +++ drivers/block/ide-probe.c Sun Feb 20 07:28:32 2000
    > @@ -154,8 +154,7 @@
    > */
    > static void delay_50ms (void)
    > {
    > - unsigned long timeout = jiffies + ((HZ + 19)/20) + 1;
    > - while (0 < (signed long)(timeout - jiffies));
    > + while (0 < (signed long)((HZ + 39)/20));
    > }
    >
    > /*
    _____
    |_____| ------------------------------------------------- ---+---+-
    | | Russell King rmk@arm.linux.org.uk --- ---
    | | | | http://www.arm.linux.org.uk/~rmk/aboutme.html / / |
    | +-+-+ --- -+-
    / | THE developer of ARM Linux |+| /|\
    / | | | --- |
    +-+-+ ------------------------------------------------- /\\\ |
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 13:56    [W:0.047 / U:87.552 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site