Skip to content

Commit 2e1e984

Browse files
JoePerchesdavem330
authored andcommitted
[ATM]: Use SEQ_START_TOKEN
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 4dfc281 commit 2e1e984

3 files changed

Lines changed: 15 additions & 14 deletions

File tree

‎net/atm/lec.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ static void *lec_tbl_walk(struct lec_state *state, struct hlist_head *tbl,
10141014

10151015
if (!e)
10161016
e = tbl->first;
1017-
if (e == (void *)1) {
1017+
if (e == SEQ_START_TOKEN) {
10181018
e = tbl->first;
10191019
--*l;
10201020
}
@@ -1116,9 +1116,9 @@ static void *lec_seq_start(struct seq_file *seq, loff_t *pos)
11161116
state->locked = NULL;
11171117
state->arp_table = 0;
11181118
state->misc_table = 0;
1119-
state->node = (void *)1;
1119+
state->node = SEQ_START_TOKEN;
11201120

1121-
return *pos ? lec_get_idx(state, *pos) : (void *)1;
1121+
return *pos ? lec_get_idx(state, *pos) : SEQ_START_TOKEN;
11221122
}
11231123

11241124
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)
11471147
" Status Flags "
11481148
"VPI/VCI Recv VPI/VCI\n";
11491149

1150-
if (v == (void *)1)
1150+
if (v == SEQ_START_TOKEN)
11511151
seq_puts(seq, lec_banner);
11521152
else {
11531153
struct lec_state *state = seq->private;

‎net/atm/proc.c‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static int __vcc_walk(struct sock **sock, int family, int *bucket, loff_t l)
7878
{
7979
struct sock *sk = *sock;
8080

81-
if (sk == (void *)1) {
81+
if (sk == SEQ_START_TOKEN) {
8282
for (*bucket = 0; *bucket < VCC_HTABLE_SIZE; ++*bucket) {
8383
struct hlist_head *head = &vcc_hash[*bucket];
8484

@@ -98,7 +98,7 @@ static int __vcc_walk(struct sock **sock, int family, int *bucket, loff_t l)
9898
sk = sk_head(&vcc_hash[*bucket]);
9999
goto try_again;
100100
}
101-
sk = (void *)1;
101+
sk = SEQ_START_TOKEN;
102102
out:
103103
*sock = sk;
104104
return (l < 0);
@@ -130,8 +130,8 @@ static void *vcc_seq_start(struct seq_file *seq, loff_t *pos)
130130
loff_t left = *pos;
131131

132132
read_lock(&vcc_sklist_lock);
133-
state->sk = (void *)1;
134-
return left ? vcc_walk(state, left) : (void *)1;
133+
state->sk = SEQ_START_TOKEN;
134+
return left ? vcc_walk(state, left) : SEQ_START_TOKEN;
135135
}
136136

137137
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)
235235
"Itf Type ESI/\"MAC\"addr "
236236
"AAL(TX,err,RX,err,drop) ... [refcnt]\n";
237237

238-
if (v == (void *)1)
238+
if (v == SEQ_START_TOKEN)
239239
seq_puts(seq, atm_dev_banner);
240240
else {
241241
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)
269269
static char atm_pvc_banner[] =
270270
"Itf VPI VCI AAL RX(PCR,Class) TX(PCR,Class)\n";
271271

272-
if (v == (void *)1)
272+
if (v == SEQ_START_TOKEN)
273273
seq_puts(seq, atm_pvc_banner);
274274
else {
275275
struct vcc_state *state = seq->private;
@@ -301,7 +301,7 @@ static const struct file_operations pvc_seq_fops = {
301301

302302
static int vcc_seq_show(struct seq_file *seq, void *v)
303303
{
304-
if (v == (void *)1) {
304+
if (v == SEQ_START_TOKEN) {
305305
seq_printf(seq, sizeof(void *) == 4 ? "%-8s%s" : "%-16s%s",
306306
"Address ", "Itf VPI VCI Fam Flags Reply "
307307
"Send buffer Recv buffer [refcnt]\n");
@@ -338,7 +338,7 @@ static int svc_seq_show(struct seq_file *seq, void *v)
338338
static char atm_svc_banner[] =
339339
"Itf VPI VCI State Remote\n";
340340

341-
if (v == (void *)1)
341+
if (v == SEQ_START_TOKEN)
342342
seq_puts(seq, atm_svc_banner);
343343
else {
344344
struct vcc_state *state = seq->private;

‎net/atm/resources.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ static __inline__ void *dev_get_idx(loff_t left)
415415
void *atm_dev_seq_start(struct seq_file *seq, loff_t *pos)
416416
{
417417
mutex_lock(&atm_dev_mutex);
418-
return *pos ? dev_get_idx(*pos) : (void *) 1;
418+
return *pos ? dev_get_idx(*pos) : SEQ_START_TOKEN;
419419
}
420420

421421
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)
426426
void *atm_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos)
427427
{
428428
++*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;
430431
return (v == &atm_devs) ? NULL : v;
431432
}
432433

0 commit comments

Comments
 (0)