On Fri, Nov 17, 2006 at 12:04:29AM +0100, Johannes Berg wrote:
> Remove things like "for (;;)" or "for (; condition ;)".
> Ever heard of while loops?

> --- wireless-dev.orig/net/d80211/sta_info.c   2006-11-16 23:40:48.164935990 
> +0100
> +++ wireless-dev/net/d80211/sta_info.c        2006-11-16 23:55:34.634935990 
> +0100
> @@ -299,7 +299,7 @@ static void sta_info_cleanup_expire_buff
>       if (skb_queue_empty(&sta->ps_tx_buf))
>               return;
>  
> -     for (;;) {
> +     while (1) {
>               spin_lock_irqsave(&sta->ps_tx_buf.lock, flags);
>               skb = skb_peek(&sta->ps_tx_buf);
>               if (sta_info_buffer_expired(local, sta, skb)) {

FWIW, I think I prefer the "for (;;)" version for endless loops.
It looks more intentional to me.  Some grep'ing showed nearly equal
usage of "for (;;)" versus "while (1)".  Is there any "official"
preference?  I don't see anything in CodingStyle about it.

I agree with the other cleanups.

John
-- 
John W. Linville
[EMAIL PROTECTED]
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to