netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: David S Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>
Subject: [PATCH net 2.6.26] net/atm - Use SEQ_START_TOKEN
Date: Wed, 02 Apr 2008 18:29:29 -0700	[thread overview]
Message-ID: <1207186169.23161.275.camel@localhost> (raw)

Signed-off-by: Joe Perches <joe@perches.com>

 net/atm/lec.c       |    8 ++++----
 net/atm/proc.c      |   16 ++++++++--------
 net/atm/resources.c |    5 +++--
 3 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/net/atm/lec.c b/net/atm/lec.c
index aa3785e..9bd64bd 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -1014,7 +1014,7 @@ static void *lec_tbl_walk(struct lec_state *state, struct hlist_head *tbl,
 
 	if (!e)
 		e = tbl->first;
-	if (e == (void *)1) {
+	if (e == SEQ_START_TOKEN) {
 		e = tbl->first;
 		--*l;
 	}
@@ -1116,9 +1116,9 @@ static void *lec_seq_start(struct seq_file *seq, loff_t *pos)
 	state->locked = NULL;
 	state->arp_table = 0;
 	state->misc_table = 0;
-	state->node = (void *)1;
+	state->node = SEQ_START_TOKEN;
 
-	return *pos ? lec_get_idx(state, *pos) : (void *)1;
+	return *pos ? lec_get_idx(state, *pos) : SEQ_START_TOKEN;
 }
 
 static void lec_seq_stop(struct seq_file *seq, void *v)
@@ -1147,7 +1147,7 @@ static int lec_seq_show(struct seq_file *seq, void *v)
 	    "                          Status            Flags "
 	    "VPI/VCI Recv VPI/VCI\n";
 
-	if (v == (void *)1)
+	if (v == SEQ_START_TOKEN)
 		seq_puts(seq, lec_banner);
 	else {
 		struct lec_state *state = seq->private;
diff --git a/net/atm/proc.c b/net/atm/proc.c
index b995b66..5c9f3d1 100644
--- a/net/atm/proc.c
+++ b/net/atm/proc.c
@@ -78,7 +78,7 @@ static int __vcc_walk(struct sock **sock, int family, int *bucket, loff_t l)
 {
 	struct sock *sk = *sock;
 
-	if (sk == (void *)1) {
+	if (sk == SEQ_START_TOKEN) {
 		for (*bucket = 0; *bucket < VCC_HTABLE_SIZE; ++*bucket) {
 			struct hlist_head *head = &vcc_hash[*bucket];
 
@@ -98,7 +98,7 @@ try_again:
 		sk = sk_head(&vcc_hash[*bucket]);
 		goto try_again;
 	}
-	sk = (void *)1;
+	sk = SEQ_START_TOKEN;
 out:
 	*sock = sk;
 	return (l < 0);
@@ -130,8 +130,8 @@ static void *vcc_seq_start(struct seq_file *seq, loff_t *pos)
 	loff_t left = *pos;
 
 	read_lock(&vcc_sklist_lock);
-	state->sk = (void *)1;
-	return left ? vcc_walk(state, left) : (void *)1;
+	state->sk = SEQ_START_TOKEN;
+	return left ? vcc_walk(state, left) : SEQ_START_TOKEN;
 }
 
 static void vcc_seq_stop(struct seq_file *seq, void *v)
@@ -235,7 +235,7 @@ static int atm_dev_seq_show(struct seq_file *seq, void *v)
 		"Itf Type    ESI/\"MAC\"addr "
 		"AAL(TX,err,RX,err,drop) ...               [refcnt]\n";
 
-	if (v == (void *)1)
+	if (v == SEQ_START_TOKEN)
 		seq_puts(seq, atm_dev_banner);
 	else {
 		struct atm_dev *dev = list_entry(v, struct atm_dev, dev_list);
@@ -269,7 +269,7 @@ static int pvc_seq_show(struct seq_file *seq, void *v)
 	static char atm_pvc_banner[] =
 		"Itf VPI VCI   AAL RX(PCR,Class) TX(PCR,Class)\n";
 
-	if (v == (void *)1)
+	if (v == SEQ_START_TOKEN)
 		seq_puts(seq, atm_pvc_banner);
 	else {
 		struct vcc_state *state = seq->private;
@@ -301,7 +301,7 @@ static const struct file_operations pvc_seq_fops = {
 
 static int vcc_seq_show(struct seq_file *seq, void *v)
 {
-	if (v == (void *)1) {
+	if (v == SEQ_START_TOKEN) {
 		seq_printf(seq, sizeof(void *) == 4 ? "%-8s%s" : "%-16s%s",
 			"Address ", "Itf VPI VCI   Fam Flags Reply "
 			"Send buffer     Recv buffer      [refcnt]\n");
@@ -338,7 +338,7 @@ static int svc_seq_show(struct seq_file *seq, void *v)
 	static char atm_svc_banner[] =
 		"Itf VPI VCI           State      Remote\n";
 
-	if (v == (void *)1)
+	if (v == SEQ_START_TOKEN)
 		seq_puts(seq, atm_svc_banner);
 	else {
 		struct vcc_state *state = seq->private;
diff --git a/net/atm/resources.c b/net/atm/resources.c
index 1bcf6dc..a34ba94 100644
--- a/net/atm/resources.c
+++ b/net/atm/resources.c
@@ -415,7 +415,7 @@ static __inline__ void *dev_get_idx(loff_t left)
 void *atm_dev_seq_start(struct seq_file *seq, loff_t *pos)
 {
 	mutex_lock(&atm_dev_mutex);
-	return *pos ? dev_get_idx(*pos) : (void *) 1;
+	return *pos ? dev_get_idx(*pos) : SEQ_START_TOKEN;
 }
 
 void atm_dev_seq_stop(struct seq_file *seq, void *v)
@@ -426,7 +426,8 @@ void atm_dev_seq_stop(struct seq_file *seq, void *v)
 void *atm_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 {
 	++*pos;
-	v = (v == (void *)1) ? atm_devs.next : ((struct list_head *)v)->next;
+	v = (v == SEQ_START_TOKEN)
+		? atm_devs.next : ((struct list_head *)v)->next;
 	return (v == &atm_devs) ? NULL : v;
 }
 



             reply	other threads:[~2008-04-03  1:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-03  1:29 Joe Perches [this message]
2008-04-10 10:45 ` [PATCH net 2.6.26] net/atm - Use SEQ_START_TOKEN David Miller

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=1207186169.23161.275.camel@localhost \
    --to=joe@perches.com \
    --cc=davem@davemloft.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 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).