aboutsummaryrefslogtreecommitdiffstats
path: root/net/atm
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2008-04-10 06:33:03 -0400
committerDavid S. Miller <davem@davemloft.net>2008-04-10 06:33:03 -0400
commit2e1e9848accba7e5f6a731bf0d0fc2c84f3ee748 (patch)
tree7e79d8938d7763f77c66b8448c358f5adc8ba14b /net/atm
parent4dfc2817025965a2fc78a18c50f540736a6b5c24 (diff)
[ATM]: Use SEQ_START_TOKEN
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/atm')
-rw-r--r--net/atm/lec.c8
-rw-r--r--net/atm/proc.c16
-rw-r--r--net/atm/resources.c5
3 files changed, 15 insertions, 14 deletions
diff --git a/net/atm/lec.c b/net/atm/lec.c
index aa3785ebf6d1..9bd64bd706b9 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,
1014 1014
1015 if (!e) 1015 if (!e)
1016 e = tbl->first; 1016 e = tbl->first;
1017 if (e == (void *)1) { 1017 if (e == SEQ_START_TOKEN) {
1018 e = tbl->first; 1018 e = tbl->first;
1019 --*l; 1019 --*l;
1020 } 1020 }
@@ -1116,9 +1116,9 @@ static void *lec_seq_start(struct seq_file *seq, loff_t *pos)
1116 state->locked = NULL; 1116 state->locked = NULL;
1117 state->arp_table = 0; 1117 state->arp_table = 0;
1118 state->misc_table = 0; 1118 state->misc_table = 0;
1119 state->node = (void *)1; 1119 state->node = SEQ_START_TOKEN;
1120 1120
1121 return *pos ? lec_get_idx(state, *pos) : (void *)1; 1121 return *pos ? lec_get_idx(state, *pos) : SEQ_START_TOKEN;
1122} 1122}
1123 1123
1124static void lec_seq_stop(struct seq_file *seq, void *v) 1124static 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)
1147 " Status Flags " 1147 " Status Flags "
1148 "VPI/VCI Recv VPI/VCI\n"; 1148 "VPI/VCI Recv VPI/VCI\n";
1149 1149
1150 if (v == (void *)1) 1150 if (v == SEQ_START_TOKEN)
1151 seq_puts(seq, lec_banner); 1151 seq_puts(seq, lec_banner);
1152 else { 1152 else {
1153 struct lec_state *state = seq->private; 1153 struct lec_state *state = seq->private;
diff --git a/net/atm/proc.c b/net/atm/proc.c
index b995b66b5585..5c9f3d148135 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)
78{ 78{
79 struct sock *sk = *sock; 79 struct sock *sk = *sock;
80 80
81 if (sk == (void *)1) { 81 if (sk == SEQ_START_TOKEN) {
82 for (*bucket = 0; *bucket < VCC_HTABLE_SIZE; ++*bucket) { 82 for (*bucket = 0; *bucket < VCC_HTABLE_SIZE; ++*bucket) {
83 struct hlist_head *head = &vcc_hash[*bucket]; 83 struct hlist_head *head = &vcc_hash[*bucket];
84 84
@@ -98,7 +98,7 @@ try_again:
98 sk = sk_head(&vcc_hash[*bucket]); 98 sk = sk_head(&vcc_hash[*bucket]);
99 goto try_again; 99 goto try_again;
100 } 100 }
101 sk = (void *)1; 101 sk = SEQ_START_TOKEN;
102out: 102out:
103 *sock = sk; 103 *sock = sk;
104 return (l < 0); 104 return (l < 0);
@@ -130,8 +130,8 @@ static void *vcc_seq_start(struct seq_file *seq, loff_t *pos)
130 loff_t left = *pos; 130 loff_t left = *pos;
131 131
132 read_lock(&vcc_sklist_lock); 132 read_lock(&vcc_sklist_lock);
133 state->sk = (void *)1; 133 state->sk = SEQ_START_TOKEN;
134 return left ? vcc_walk(state, left) : (void *)1; 134 return left ? vcc_walk(state, left) : SEQ_START_TOKEN;
135} 135}
136 136
137static void vcc_seq_stop(struct seq_file *seq, void *v) 137static 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)
235 "Itf Type ESI/\"MAC\"addr " 235 "Itf Type ESI/\"MAC\"addr "
236 "AAL(TX,err,RX,err,drop) ... [refcnt]\n"; 236 "AAL(TX,err,RX,err,drop) ... [refcnt]\n";
237 237
238 if (v == (void *)1) 238 if (v == SEQ_START_TOKEN)
239 seq_puts(seq, atm_dev_banner); 239 seq_puts(seq, atm_dev_banner);
240 else { 240 else {
241 struct atm_dev *dev = list_entry(v, struct atm_dev, dev_list); 241 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)
269 static char atm_pvc_banner[] = 269 static char atm_pvc_banner[] =
270 "Itf VPI VCI AAL RX(PCR,Class) TX(PCR,Class)\n"; 270 "Itf VPI VCI AAL RX(PCR,Class) TX(PCR,Class)\n";
271 271
272 if (v == (void *)1) 272 if (v == SEQ_START_TOKEN)
273 seq_puts(seq, atm_pvc_banner); 273 seq_puts(seq, atm_pvc_banner);
274 else { 274 else {
275 struct vcc_state *state = seq->private; 275 struct vcc_state *state = seq->private;
@@ -301,7 +301,7 @@ static const struct file_operations pvc_seq_fops = {
301 301
302static int vcc_seq_show(struct seq_file *seq, void *v) 302static int vcc_seq_show(struct seq_file *seq, void *v)
303{ 303{
304 if (v == (void *)1) { 304 if (v == SEQ_START_TOKEN) {
305 seq_printf(seq, sizeof(void *) == 4 ? "%-8s%s" : "%-16s%s", 305 seq_printf(seq, sizeof(void *) == 4 ? "%-8s%s" : "%-16s%s",
306 "Address ", "Itf VPI VCI Fam Flags Reply " 306 "Address ", "Itf VPI VCI Fam Flags Reply "
307 "Send buffer Recv buffer [refcnt]\n"); 307 "Send buffer Recv buffer [refcnt]\n");
@@ -338,7 +338,7 @@ static int svc_seq_show(struct seq_file *seq, void *v)
338 static char atm_svc_banner[] = 338 static char atm_svc_banner[] =
339 "Itf VPI VCI State Remote\n"; 339 "Itf VPI VCI State Remote\n";
340 340
341 if (v == (void *)1) 341 if (v == SEQ_START_TOKEN)
342 seq_puts(seq, atm_svc_banner); 342 seq_puts(seq, atm_svc_banner);
343 else { 343 else {
344 struct vcc_state *state = seq->private; 344 struct vcc_state *state = seq->private;
diff --git a/net/atm/resources.c b/net/atm/resources.c
index 1bcf6dc8d409..a34ba948af96 100644
--- a/net/atm/resources.c
+++ b/net/atm/resources.c
@@ -415,7 +415,7 @@ static __inline__ void *dev_get_idx(loff_t left)
415void *atm_dev_seq_start(struct seq_file *seq, loff_t *pos) 415void *atm_dev_seq_start(struct seq_file *seq, loff_t *pos)
416{ 416{
417 mutex_lock(&atm_dev_mutex); 417 mutex_lock(&atm_dev_mutex);
418 return *pos ? dev_get_idx(*pos) : (void *) 1; 418 return *pos ? dev_get_idx(*pos) : SEQ_START_TOKEN;
419} 419}
420 420
421void atm_dev_seq_stop(struct seq_file *seq, void *v) 421void 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)
426void *atm_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos) 426void *atm_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos)
427{ 427{
428 ++*pos; 428 ++*pos;
429 v = (v == (void *)1) ? atm_devs.next : ((struct list_head *)v)->next; 429 v = (v == SEQ_START_TOKEN)
430 ? atm_devs.next : ((struct list_head *)v)->next;
430 return (v == &atm_devs) ? NULL : v; 431 return (v == &atm_devs) ? NULL : v;
431} 432}
432 433