From: Bob Miller <rem@osdl.org>
To: davem@redhat.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 2.5.51] Remove compile warnings from ipv4/raw.c and ipv4/arp.c
Date: Wed, 11 Dec 2002 14:32:50 -0800 [thread overview]
Message-ID: <20021211223250.GE1067@doc.pdx.osdl.net> (raw)
Recoded a couple of routines (neigh_get_next()/raw_get_next()) to remove
goto's jumping back into the middle of do {} while(); loop. This removes the
warning: deprecated use of label at end of compound statement
from these two files.
diff -Nru a/net/ipv4/arp.c b/net/ipv4/arp.c
--- a/net/ipv4/arp.c Wed Dec 11 13:41:51 2002
+++ b/net/ipv4/arp.c Wed Dec 11 13:41:51 2002
@@ -1168,19 +1168,19 @@
{
struct arp_iter_state* state = seq->private;
- do {
- n = n->next;
+ n = n->next;
+ while (n != NULL) {
/* Don't confuse "arp -a" w/ magic entries */
-try_again:
- } while (n && !(n->nud_state & ~NUD_NOARP));
+ if ((n->nud_state == 0) || (n->nud_state == NUD_NOARP)) {
+ n = n->next;
+ } else {
+ if (++state->bucket > NEIGH_HASHMASK) {
+ break;
+ }
+ n = arp_tbl.hash_buckets[state->bucket];
+ }
+ }
- if (n)
- goto out;
- if (++state->bucket > NEIGH_HASHMASK)
- goto out;
- n = arp_tbl.hash_buckets[state->bucket];
- goto try_again;
-out:
return n;
}
diff -Nru a/net/ipv4/raw.c b/net/ipv4/raw.c
--- a/net/ipv4/raw.c Wed Dec 11 13:41:51 2002
+++ b/net/ipv4/raw.c Wed Dec 11 13:41:51 2002
@@ -712,14 +712,17 @@
{
struct raw_iter_state* state = raw_seq_private(seq);
- do {
- sk = sk->next;
-try_again:
- } while (sk && sk->family != PF_INET);
-
- if (!sk && ++state->bucket < RAWV4_HTABLE_SIZE) {
- sk = raw_v4_htable[state->bucket];
- goto try_again;
+ sk = sk->next;
+ while (sk != NULL) {
+ if (sk->family == PF_INET) {
+ if (++state->bucket < RAWV4_HTABLE_SIZE) {
+ sk = raw_v4_htable[state->bucket];
+ } else {
+ break;
+ }
+ } else {
+ sk = sk->next;
+ }
}
return sk;
}
--
Bob Miller Email: rem@osdl.org
Open Source Development Lab Phone: 503.626.2455 Ext. 17
reply other threads:[~2002-12-11 22:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20021211223250.GE1067@doc.pdx.osdl.net \
--to=rem@osdl.org \
--cc=davem@redhat.com \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®