Commit b95f9e50 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds

[PATCH] Use SEQ_START_TOKEN in drivers/net/* [1/3]

parent b0882dfe
...@@ -389,8 +389,6 @@ static const char * bpq_print_ethaddr(const unsigned char *e) ...@@ -389,8 +389,6 @@ static const char * bpq_print_ethaddr(const unsigned char *e)
return buf; return buf;
} }
#define BPQ_PROC_START ((void *)1)
static void *bpq_seq_start(struct seq_file *seq, loff_t *pos) static void *bpq_seq_start(struct seq_file *seq, loff_t *pos)
{ {
int i = 1; int i = 1;
...@@ -399,7 +397,7 @@ static void *bpq_seq_start(struct seq_file *seq, loff_t *pos) ...@@ -399,7 +397,7 @@ static void *bpq_seq_start(struct seq_file *seq, loff_t *pos)
rcu_read_lock(); rcu_read_lock();
if (*pos == 0) if (*pos == 0)
return BPQ_PROC_START; return SEQ_START_TOKEN;
list_for_each_entry(bpqdev, &bpq_devices, bpq_list) { list_for_each_entry(bpqdev, &bpq_devices, bpq_list) {
if (i == *pos) if (i == *pos)
...@@ -414,7 +412,7 @@ static void *bpq_seq_next(struct seq_file *seq, void *v, loff_t *pos) ...@@ -414,7 +412,7 @@ static void *bpq_seq_next(struct seq_file *seq, void *v, loff_t *pos)
++*pos; ++*pos;
if (v == BPQ_PROC_START) if (v == SEQ_START_TOKEN)
p = bpq_devices.next; p = bpq_devices.next;
else else
p = ((struct bpqdev *)v)->bpq_list.next; p = ((struct bpqdev *)v)->bpq_list.next;
...@@ -431,7 +429,7 @@ static void bpq_seq_stop(struct seq_file *seq, void *v) ...@@ -431,7 +429,7 @@ static void bpq_seq_stop(struct seq_file *seq, void *v)
static int bpq_seq_show(struct seq_file *seq, void *v) static int bpq_seq_show(struct seq_file *seq, void *v)
{ {
if (v == BPQ_PROC_START) if (v == SEQ_START_TOKEN)
seq_puts(seq, seq_puts(seq,
"dev ether destination accept from\n"); "dev ether destination accept from\n");
else { else {
......
...@@ -986,7 +986,7 @@ static int pppoe_seq_show(struct seq_file *seq, void *v) ...@@ -986,7 +986,7 @@ static int pppoe_seq_show(struct seq_file *seq, void *v)
struct pppox_opt *po; struct pppox_opt *po;
char *dev_name; char *dev_name;
if (v == (void *)1) { if (v == SEQ_START_TOKEN) {
seq_puts(seq, "Id Address Device\n"); seq_puts(seq, "Id Address Device\n");
goto out; goto out;
} }
...@@ -1025,7 +1025,7 @@ static void *pppoe_seq_start(struct seq_file *seq, loff_t *pos) ...@@ -1025,7 +1025,7 @@ static void *pppoe_seq_start(struct seq_file *seq, loff_t *pos)
loff_t l = *pos; loff_t l = *pos;
read_lock_bh(&pppoe_hash_lock); read_lock_bh(&pppoe_hash_lock);
return l ? pppoe_get_idx(--l) : (void *)1; return l ? pppoe_get_idx(--l) : SEQ_START_TOKEN;
} }
static void *pppoe_seq_next(struct seq_file *seq, void *v, loff_t *pos) static void *pppoe_seq_next(struct seq_file *seq, void *v, loff_t *pos)
...@@ -1033,7 +1033,7 @@ static void *pppoe_seq_next(struct seq_file *seq, void *v, loff_t *pos) ...@@ -1033,7 +1033,7 @@ static void *pppoe_seq_next(struct seq_file *seq, void *v, loff_t *pos)
struct pppox_opt *po; struct pppox_opt *po;
++*pos; ++*pos;
if (v == (void *)1) { if (v == SEQ_START_TOKEN) {
po = pppoe_get_idx(0); po = pppoe_get_idx(0);
goto out; goto out;
} }
......
...@@ -965,8 +965,6 @@ static char *time_delta(char buffer[], long time) ...@@ -965,8 +965,6 @@ static char *time_delta(char buffer[], long time)
return (buffer); return (buffer);
} }
#define STRIP_PROC_HEADER ((void *)1)
/* get Nth element of the linked list */ /* get Nth element of the linked list */
static struct strip *strip_get_idx(loff_t pos) static struct strip *strip_get_idx(loff_t pos)
{ {
...@@ -984,7 +982,7 @@ static struct strip *strip_get_idx(loff_t pos) ...@@ -984,7 +982,7 @@ static struct strip *strip_get_idx(loff_t pos)
static void *strip_seq_start(struct seq_file *seq, loff_t *pos) static void *strip_seq_start(struct seq_file *seq, loff_t *pos)
{ {
rcu_read_lock(); rcu_read_lock();
return *pos ? strip_get_idx(*pos - 1) : STRIP_PROC_HEADER; return *pos ? strip_get_idx(*pos - 1) : SEQ_START_TOKEN;
} }
static void *strip_seq_next(struct seq_file *seq, void *v, loff_t *pos) static void *strip_seq_next(struct seq_file *seq, void *v, loff_t *pos)
...@@ -993,7 +991,7 @@ static void *strip_seq_next(struct seq_file *seq, void *v, loff_t *pos) ...@@ -993,7 +991,7 @@ static void *strip_seq_next(struct seq_file *seq, void *v, loff_t *pos)
struct strip *s; struct strip *s;
++*pos; ++*pos;
if (v == STRIP_PROC_HEADER) if (v == SEQ_START_TOKEN)
return strip_get_idx(1); return strip_get_idx(1);
s = v; s = v;
...@@ -1149,7 +1147,7 @@ static void strip_seq_status_info(struct seq_file *seq, ...@@ -1149,7 +1147,7 @@ static void strip_seq_status_info(struct seq_file *seq,
*/ */
static int strip_seq_show(struct seq_file *seq, void *v) static int strip_seq_show(struct seq_file *seq, void *v)
{ {
if (v == STRIP_PROC_HEADER) if (v == SEQ_START_TOKEN)
seq_printf(seq, "strip_version: %s\n", StripVersion); seq_printf(seq, "strip_version: %s\n", StripVersion);
else else
strip_seq_status_info(seq, (const struct strip *)v); strip_seq_status_info(seq, (const struct strip *)v);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment