Re: Wireless IBSS on Linux-2.6.34 broken by commit3bbb9ec946428b96657126768f65487a48dd090c

From: Linus Torvalds
Date: Mon May 24 2010 - 11:00:48 EST




On Mon, 24 May 2010, Jeff Chua wrote:
>
> - expires_limit = expires + timer->slack;
> + expires_limit = expires;
>
> - if (timer->slack < 0) /* auto slack: use 0.4% */
> + if (timer->slack > -1)
> + expires_limit = expires + timer->slack;
> + else if (time_after(expires, jiffies)) /* auto slack: use 0.4% */
> expires_limit = expires + (expires - jiffies)/256;

Please don't reload 'jiffies' twice. It's volatile, and the compiler will
do a crap job of it.

Also, '0' is a normal number, but '-1' is a rather odd value. Please just
test for non-negative by doing ">= 0" rather than "> -1"

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