Re: [patch] fix common mistake in polling loops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/28/06, Zed 0xff <[email protected]> wrote:
@@ -955,11 +956,15 @@ static void psmouse_resync(void *p)
 * repeat our attempts 5 times, otherwise we may be left out with disabled
 * mouse.
 */
-       for (i = 0; i < 5; i++) {
+       timeout = jiffies + msecs_to_jiffies(1000);
+       for (;;) {
               if (!ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_ENABLE)) {
                       enabled = 1;
                       break;
               }
+               if (time_after(timeout, jiffies)) {
+                       break;
+               }
               msleep(200);
       }


NAK. Have you read the comment above (that is partially visible in
your diff)? I do not really care about timeout here, I want my mouse
working.

--
Dmitry
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux