From: Horms <horms@verge.net.au>
To: netdev@vger.kernel.org
Cc: David Miller <davem@davemloft.net>,
Wensong Zhan <wensong@linux-vs.org>, Julian Anastasov <ja@ssi.bg>,
Roberto Nibali <ratz@drugphish.ch>,
Joseph Mack NA3T <jmack@wm7d.net>
Subject: [PATCH] [IPVS] replace if .. goto with while
Date: Mon, 18 Dec 2006 12:11:11 +0900 [thread overview]
Message-ID: <20061218031110.GA32036@verge.net.au> (raw)
I guess that this code used to be more complex, but replacing
the goto with a while seems to make things a bit more readable.
Or in other words, two fairly gratuitous goto are removed.
On a related note, I wonder if there should be a limit to how
many times it tries.
Signed-Off-By: Simon Horman <horms@verge.net.au>
Index: linux-2.6/net/ipv4/ipvs/ip_vs_sync.c
===================================================================
--- linux-2.6.orig/net/ipv4/ipvs/ip_vs_sync.c 2006-11-29 09:50:37.000000000 +0900
+++ linux-2.6/net/ipv4/ipvs/ip_vs_sync.c 2006-11-29 10:03:11.000000000 +0900
@@ -822,12 +822,10 @@
/* fork the sync thread here, then the parent process of the
sync thread is the init process after this thread exits. */
- repeat:
- if ((pid = kernel_thread(sync_thread, startup, 0)) < 0) {
+ while ((pid = kernel_thread(sync_thread, startup, 0)) < 0) {
IP_VS_ERR("could not create sync_thread due to %d... "
"retrying.\n", pid);
msleep_interruptible(1000);
- goto repeat;
}
return 0;
@@ -856,12 +854,10 @@
ip_vs_backup_syncid = syncid;
}
- repeat:
- if ((pid = kernel_thread(fork_sync_thread, &startup, 0)) < 0) {
+ while ((pid = kernel_thread(fork_sync_thread, &startup, 0)) < 0) {
IP_VS_ERR("could not create fork_sync_thread due to %d... "
"retrying.\n", pid);
msleep_interruptible(1000);
- goto repeat;
}
wait_for_completion(&startup);
next reply other threads:[~2006-12-18 3:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-18 3:11 Horms [this message]
2007-01-02 8:38 ` [PATCH] [IPVS] replace if .. goto with while David Miller
2007-01-03 13:37 ` Horms
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=20061218031110.GA32036@verge.net.au \
--to=horms@verge.net.au \
--cc=davem@davemloft.net \
--cc=ja@ssi.bg \
--cc=jmack@wm7d.net \
--cc=netdev@vger.kernel.org \
--cc=ratz@drugphish.ch \
--cc=wensong@linux-vs.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).