From: "John W. Linville" <linville@tuxdriver.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: netdev <netdev@vger.kernel.org>, Jiri Benc <jbenc@suse.cz>
Subject: Re: d80211: clean up some list and loop code
Date: Thu, 16 Nov 2006 18:25:01 -0500 [thread overview]
Message-ID: <20061116232455.GA3297@tuxdriver.com> (raw)
In-Reply-To: <1163718270.3392.19.camel@johannes.berg>
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
linville@tuxdriver.com
next prev parent reply other threads:[~2006-11-16 23:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-16 23:04 d80211: clean up some list and loop code Johannes Berg
2006-11-16 23:25 ` John W. Linville [this message]
2006-11-16 23:37 ` Johannes Berg
2006-11-17 0:00 ` John W. Linville
2006-11-17 0:26 ` John W. Linville
2006-11-17 2:37 ` Dave Dillow
2006-11-16 23:40 ` Jouni Malinen
2006-11-16 23:42 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061116232455.GA3297@tuxdriver.com \
--to=linville@tuxdriver.com \
--cc=jbenc@suse.cz \
--cc=johannes@sipsolutions.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.