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

[PATCH] Use SEQ_START_TOKEN in include/net/* [3/3]

parent 18d0a2b7
......@@ -464,8 +464,6 @@ static void rif_check_expire(unsigned long dummy)
*/
#ifdef CONFIG_PROC_FS
/* Magic token to indicate first entry (header line) */
#define RIF_PROC_START ((void *)1)
static struct rif_cache_s *rif_get_idx(loff_t pos)
{
......@@ -487,7 +485,7 @@ static void *rif_seq_start(struct seq_file *seq, loff_t *pos)
{
spin_lock_bh(&rif_lock);
return *pos ? rif_get_idx(*pos - 1) : RIF_PROC_START;
return *pos ? rif_get_idx(*pos - 1) : SEQ_START_TOKEN;
}
static void *rif_seq_next(struct seq_file *seq, void *v, loff_t *pos)
......@@ -497,7 +495,7 @@ static void *rif_seq_next(struct seq_file *seq, void *v, loff_t *pos)
++*pos;
if (v == RIF_PROC_START) {
if (v == SEQ_START_TOKEN) {
i = -1;
goto scan;
}
......@@ -524,7 +522,7 @@ static int rif_seq_show(struct seq_file *seq, void *v)
int j, rcf_len, segment, brdgnmb;
struct rif_cache_s *entry = v;
if (v == RIF_PROC_START)
if (v == SEQ_START_TOKEN)
seq_puts(seq,
"if TR address TTL rcf routing segments\n");
else {
......
......@@ -46,10 +46,6 @@ static void *vlan_seq_next(struct seq_file *seq, void *v, loff_t *pos);
static void vlan_seq_stop(struct seq_file *seq, void *);
static int vlandev_seq_show(struct seq_file *seq, void *v);
/* Miscellaneous */
#define SEQ_START_TOKEN ((void *) 1)
/*
* Global Data
*/
......
......@@ -941,7 +941,7 @@ static void *aarp_seq_start(struct seq_file *seq, loff_t *pos)
iter->table = resolved;
iter->bucket = 0;
return *pos ? iter_next(iter, pos) : ((void *)1);
return *pos ? iter_next(iter, pos) : SEQ_START_TOKEN);
}
static void *aarp_seq_next(struct seq_file *seq, void *v, loff_t *pos)
......@@ -952,7 +952,7 @@ static void *aarp_seq_next(struct seq_file *seq, void *v, loff_t *pos)
++*pos;
/* first line after header */
if (v == ((void *)1))
if (v == SEQ_START_TOKEN)
entry = iter_next(iter, NULL);
/* next entry in current bucket */
......@@ -987,7 +987,7 @@ static int aarp_seq_show(struct seq_file *seq, void *v)
struct aarp_entry *entry = v;
unsigned long now = jiffies;
if (v == ((void *)1))
if (v == SEQ_START_TOKEN)
seq_puts(seq,
"Address Interface Hardware Address"
" Expires LastSend Retry Status\n");
......
......@@ -33,7 +33,7 @@ static void *atalk_seq_interface_start(struct seq_file *seq, loff_t *pos)
loff_t l = *pos;
read_lock_bh(&atalk_interfaces_lock);
return l ? atalk_get_interface_idx(--l) : (void *)1;
return l ? atalk_get_interface_idx(--l) : SEQ_START_TOKEN;
}
static void *atalk_seq_interface_next(struct seq_file *seq, void *v, loff_t *pos)
......@@ -41,7 +41,7 @@ static void *atalk_seq_interface_next(struct seq_file *seq, void *v, loff_t *pos
struct atalk_iface *i;
++*pos;
if (v == (void *)1) {
if (v == SEQ_START_TOKEN) {
i = NULL;
if (atalk_interfaces)
i = atalk_interfaces;
......@@ -62,7 +62,7 @@ static int atalk_seq_interface_show(struct seq_file *seq, void *v)
{
struct atalk_iface *iface;
if (v == (void *)1) {
if (v == SEQ_START_TOKEN) {
seq_puts(seq, "Interface Address Networks "
"Status\n");
goto out;
......@@ -92,7 +92,7 @@ static void *atalk_seq_route_start(struct seq_file *seq, loff_t *pos)
loff_t l = *pos;
read_lock_bh(&atalk_routes_lock);
return l ? atalk_get_route_idx(--l) : (void *)1;
return l ? atalk_get_route_idx(--l) : SEQ_START_TOKEN;
}
static void *atalk_seq_route_next(struct seq_file *seq, void *v, loff_t *pos)
......@@ -100,7 +100,7 @@ static void *atalk_seq_route_next(struct seq_file *seq, void *v, loff_t *pos)
struct atalk_route *r;
++*pos;
if (v == (void *)1) {
if (v == SEQ_START_TOKEN) {
r = NULL;
if (atalk_routes)
r = atalk_routes;
......@@ -121,7 +121,7 @@ static int atalk_seq_route_show(struct seq_file *seq, void *v)
{
struct atalk_route *rt;
if (v == (void *)1) {
if (v == SEQ_START_TOKEN) {
seq_puts(seq, "Target Router Flags Dev\n");
goto out;
}
......@@ -160,7 +160,7 @@ static void *atalk_seq_socket_start(struct seq_file *seq, loff_t *pos)
loff_t l = *pos;
read_lock_bh(&atalk_sockets_lock);
return l ? atalk_get_socket_idx(--l) : (void *)1;
return l ? atalk_get_socket_idx(--l) : SEQ_START_TOKEN;
}
static void *atalk_seq_socket_next(struct seq_file *seq, void *v, loff_t *pos)
......@@ -168,7 +168,7 @@ static void *atalk_seq_socket_next(struct seq_file *seq, void *v, loff_t *pos)
struct sock *i;
++*pos;
if (v == (void *)1) {
if (v == SEQ_START_TOKEN) {
i = sk_head(&atalk_sockets);
goto out;
}
......@@ -187,7 +187,7 @@ static int atalk_seq_socket_show(struct seq_file *seq, void *v)
struct sock *s;
struct atalk_sock *at;
if (v == (void *)1) {
if (v == SEQ_START_TOKEN) {
seq_printf(seq, "Type Local_addr Remote_addr Tx_queue "
"Rx_queue St UID\n");
goto out;
......
......@@ -281,8 +281,6 @@ int ax25_rt_ioctl(unsigned int cmd, void *arg)
#ifdef CONFIG_PROC_FS
#define AX25_PROC_START ((void *)1)
static void *ax25_rt_seq_start(struct seq_file *seq, loff_t *pos)
{
struct ax25_route *ax25_rt;
......@@ -290,7 +288,7 @@ static void *ax25_rt_seq_start(struct seq_file *seq, loff_t *pos)
read_lock(&ax25_route_lock);
if (*pos == 0)
return AX25_PROC_START;
return SEQ_START_TOKEN;
for (ax25_rt = ax25_route_list; ax25_rt != NULL; ax25_rt = ax25_rt->next) {
if (i == *pos)
......@@ -304,7 +302,7 @@ static void *ax25_rt_seq_start(struct seq_file *seq, loff_t *pos)
static void *ax25_rt_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
++*pos;
return (v == AX25_PROC_START) ? ax25_route_list :
return (v == SEQ_START_TOKEN) ? ax25_route_list :
((struct ax25_route *) v)->next;
}
......@@ -315,7 +313,7 @@ static void ax25_rt_seq_stop(struct seq_file *seq, void *v)
static int ax25_rt_seq_show(struct seq_file *seq, void *v)
{
if (v == AX25_PROC_START)
if (v == SEQ_START_TOKEN)
seq_puts(seq, "callsign dev mode digipeaters\n");
else {
struct ax25_route *ax25_rt = v;
......
......@@ -144,8 +144,6 @@ int ax25_uid_ioctl(int cmd, struct sockaddr_ax25 *sax)
#ifdef CONFIG_PROC_FS
#define AX25_PROC_START ((void *)1)
static void *ax25_uid_seq_start(struct seq_file *seq, loff_t *pos)
{
struct ax25_uid_assoc *pt;
......@@ -153,7 +151,7 @@ static void *ax25_uid_seq_start(struct seq_file *seq, loff_t *pos)
read_lock(&ax25_uid_lock);
if (*pos == 0)
return AX25_PROC_START;
return SEQ_START_TOKEN;
for (pt = ax25_uid_list; pt != NULL; pt = pt->next) {
if (i == *pos)
......@@ -166,7 +164,7 @@ static void *ax25_uid_seq_start(struct seq_file *seq, loff_t *pos)
static void *ax25_uid_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
++*pos;
return (v == AX25_PROC_START) ? ax25_uid_list :
return (v == SEQ_START_TOKEN) ? ax25_uid_list :
((struct ax25_uid_assoc *) v)->next;
}
......@@ -177,7 +175,7 @@ static void ax25_uid_seq_stop(struct seq_file *seq, void *v)
static int ax25_uid_seq_show(struct seq_file *seq, void *v)
{
if (v == AX25_PROC_START)
if (v == SEQ_START_TOKEN)
seq_printf(seq, "Policy: %d\n", ax25_uid_policy);
else {
struct ax25_uid_assoc *pt = v;
......
......@@ -1844,13 +1844,13 @@ static __inline__ struct net_device *dev_get_idx(loff_t pos)
void *dev_seq_start(struct seq_file *seq, loff_t *pos)
{
read_lock(&dev_base_lock);
return *pos ? dev_get_idx(*pos - 1) : (void *)1;
return *pos ? dev_get_idx(*pos - 1) : SEQ_START_TOKEN;
}
void *dev_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
++*pos;
return v == (void *)1 ? dev_base : ((struct net_device *)v)->next;
return v == SEQ_START_TOKEN ? dev_base : ((struct net_device *)v)->next;
}
void dev_seq_stop(struct seq_file *seq, void *v)
......@@ -1890,7 +1890,7 @@ static void dev_seq_printf_stats(struct seq_file *seq, struct net_device *dev)
*/
static int dev_seq_show(struct seq_file *seq, void *v)
{
if (v == (void *)1)
if (v == SEQ_START_TOKEN)
seq_puts(seq, "Inter-| Receive "
" | Transmit\n"
" face |bytes packets errs drop fifo frame "
......
......@@ -458,7 +458,7 @@ static __inline__ void wireless_seq_printf_stats(struct seq_file *seq,
*/
static int wireless_seq_show(struct seq_file *seq, void *v)
{
if (v == (void *)1)
if (v == SEQ_START_TOKEN)
seq_printf(seq, "Inter-| sta-| Quality | Discarded "
"packets | Missed | WE\n"
" face | tus | link level noise | nwid "
......
......@@ -2146,14 +2146,14 @@ static void *dn_socket_get_idx(struct seq_file *seq, loff_t pos)
static void *dn_socket_seq_start(struct seq_file *seq, loff_t *pos)
{
return *pos ? dn_socket_get_idx(seq, *pos - 1) : (void*)1;
return *pos ? dn_socket_get_idx(seq, *pos - 1) : SEQ_START_TOKEN;
}
static void *dn_socket_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
void *rc;
if (v == (void*)1) {
if (v == SEQ_START_TOKEN) {
rc = dn_socket_get_idx(seq, 0);
goto out;
}
......@@ -2169,7 +2169,7 @@ static void *dn_socket_seq_next(struct seq_file *seq, void *v, loff_t *pos)
static void dn_socket_seq_stop(struct seq_file *seq, void *v)
{
if (v && v != (void*)1)
if (v && v != SEQ_START_TOKEN)
read_unlock_bh(&dn_hash_lock);
}
......@@ -2269,7 +2269,7 @@ static inline void dn_socket_format_entry(struct seq_file *seq, struct sock *sk)
static int dn_socket_seq_show(struct seq_file *seq, void *v)
{
if (v == (void*)1) {
if (v == SEQ_START_TOKEN) {
seq_puts(seq, "Local Remote\n");
} else {
dn_socket_format_entry(seq, v);
......
......@@ -1365,7 +1365,7 @@ static void *dn_dev_seq_start(struct seq_file *seq, loff_t *pos)
read_unlock(&dev_base_lock);
return dev;
}
return (void*)1;
return SEQ_START_TOKEN;
}
static void *dn_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos)
......@@ -1373,7 +1373,7 @@ static void *dn_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos)
struct net_device *dev = v;
loff_t one = 1;
if (v == (void*)1) {
if (v == SEQ_START_TOKEN) {
dev = dn_dev_seq_start(seq, &one);
} else {
dev = dn_dev_get_next(seq, dev);
......@@ -1386,7 +1386,7 @@ static void *dn_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos)
static void dn_dev_seq_stop(struct seq_file *seq, void *v)
{
if (v && v != (void*)1)
if (v && v != SEQ_START_TOKEN)
read_unlock(&dev_base_lock);
}
......@@ -1406,7 +1406,7 @@ static char *dn_type2asc(char type)
static int dn_dev_seq_show(struct seq_file *seq, void *v)
{
if (v == (void*)1)
if (v == SEQ_START_TOKEN)
seq_puts(seq, "Name Flags T1 Timer1 T3 Timer3 BlkSize Pri State DevType Router Peer\n");
else {
struct net_device *dev = v;
......
......@@ -604,7 +604,7 @@ static void *dn_neigh_get_idx(struct seq_file *seq, loff_t pos)
static void *dn_neigh_seq_start(struct seq_file *seq, loff_t *pos)
{
return *pos ? dn_neigh_get_idx(seq, *pos - 1) : (void*)1;
return *pos ? dn_neigh_get_idx(seq, *pos - 1) : SEQ_START_TOKEN;
}
static void *dn_neigh_seq_next(struct seq_file *seq, void *v, loff_t *pos)
......@@ -612,7 +612,7 @@ static void *dn_neigh_seq_next(struct seq_file *seq, void *v, loff_t *pos)
void *rc;
if (v == (void*)1) {
if (v == SEQ_START_TOKEN) {
rc = dn_neigh_get_idx(seq, 0);
goto out;
}
......@@ -628,7 +628,7 @@ static void *dn_neigh_seq_next(struct seq_file *seq, void *v, loff_t *pos)
static void dn_neigh_seq_stop(struct seq_file *seq, void *v)
{
if (v && v != (void*)1)
if (v && v != SEQ_START_TOKEN)
read_unlock_bh(&dn_neigh_table.lock);
}
......@@ -653,7 +653,7 @@ static inline void dn_neigh_format_entry(struct seq_file *seq,
static int dn_neigh_seq_show(struct seq_file *seq, void *v)
{
if (v == (void*)1) {
if (v == SEQ_START_TOKEN) {
seq_puts(seq, "Addr Flags State Use Blksize Dev\n");
} else {
dn_neigh_format_entry(seq, v);
......
......@@ -1275,7 +1275,7 @@ static void *arp_get_idx(struct seq_file *seq, loff_t pos)
static void *arp_seq_start(struct seq_file *seq, loff_t *pos)
{
return *pos ? arp_get_idx(seq, *pos - 1) : (void *)1;
return *pos ? arp_get_idx(seq, *pos - 1) : SEQ_START_TOKEN;
}
static void *arp_seq_next(struct seq_file *seq, void *v, loff_t *pos)
......@@ -1283,7 +1283,7 @@ static void *arp_seq_next(struct seq_file *seq, void *v, loff_t *pos)
void *rc;
struct arp_iter_state* state;
if (v == (void *)1) {
if (v == SEQ_START_TOKEN) {
rc = arp_get_idx(seq, 0);
goto out;
}
......@@ -1306,7 +1306,7 @@ static void arp_seq_stop(struct seq_file *seq, void *v)
{
struct arp_iter_state* state = seq->private;
if (!state->is_pneigh && v != (void *)1)
if (!state->is_pneigh && v != SEQ_START_TOKEN)
read_unlock_bh(&arp_tbl.lock);
}
......@@ -1359,7 +1359,7 @@ static __inline__ void arp_format_pneigh_entry(struct seq_file *seq,
static int arp_seq_show(struct seq_file *seq, void *v)
{
if (v == (void *)1)
if (v == SEQ_START_TOKEN)
seq_puts(seq, "IP address HW type Flags "
"HW address Mask Device\n");
else {
......
......@@ -979,14 +979,14 @@ static void *fib_seq_start(struct seq_file *seq, loff_t *pos)
read_lock(&fib_hash_lock);
if (ip_fib_main_table)
v = *pos ? fib_get_next(seq) : (void *)1;
v = *pos ? fib_get_next(seq) : SEQ_START_TOKEN;
return v;
}
static void *fib_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
++*pos;
return v == (void *)1 ? fib_get_first(seq) : fib_get_next(seq);
return v == SEQ_START_TOKEN ? fib_get_first(seq) : fib_get_next(seq);
}
static void fib_seq_stop(struct seq_file *seq, void *v)
......@@ -1025,7 +1025,7 @@ static int fib_seq_show(struct seq_file *seq, void *v)
struct fib_node *f;
struct fib_info *fi;
if (v == (void *)1) {
if (v == SEQ_START_TOKEN) {
seq_printf(seq, "%-127s\n", "Iface\tDestination\tGateway "
"\tFlags\tRefCnt\tUse\tMetric\tMask\t\tMTU"
"\tWindow\tIRTT");
......
......@@ -2162,13 +2162,13 @@ static struct ip_mc_list *igmp_mc_get_idx(struct seq_file *seq, loff_t pos)
static void *igmp_mc_seq_start(struct seq_file *seq, loff_t *pos)
{
read_lock(&dev_base_lock);
return *pos ? igmp_mc_get_idx(seq, *pos) : (void *)1;
return *pos ? igmp_mc_get_idx(seq, *pos) : SEQ_START_TOKEN;
}
static void *igmp_mc_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
struct ip_mc_list *im;
if (v == (void *)1)
if (v == SEQ_START_TOKEN)
im = igmp_mc_get_first(seq);
else
im = igmp_mc_get_next(seq, v);
......@@ -2190,7 +2190,7 @@ static void igmp_mc_seq_stop(struct seq_file *seq, void *v)
static int igmp_mc_seq_show(struct seq_file *seq, void *v)
{
if (v == (void *)1)
if (v == SEQ_START_TOKEN)
seq_printf(seq,
"Idx\tDevice : Count Querier\tGroup Users Timer\tReporter\n");
else {
......@@ -2337,13 +2337,13 @@ static struct ip_sf_list *igmp_mcf_get_idx(struct seq_file *seq, loff_t pos)
static void *igmp_mcf_seq_start(struct seq_file *seq, loff_t *pos)
{
read_lock(&dev_base_lock);
return *pos ? igmp_mcf_get_idx(seq, *pos) : (void *)1;
return *pos ? igmp_mcf_get_idx(seq, *pos) : SEQ_START_TOKEN;
}
static void *igmp_mcf_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
struct ip_sf_list *psf;
if (v == (void *)1)
if (v == SEQ_START_TOKEN)
psf = igmp_mcf_get_first(seq);
else
psf = igmp_mcf_get_next(seq, v);
......@@ -2372,7 +2372,7 @@ static int igmp_mcf_seq_show(struct seq_file *seq, void *v)
struct ip_sf_list *psf = (struct ip_sf_list *)v;
struct igmp_mcf_iter_state *state = igmp_mcf_seq_private(seq);
if (v == (void *)1) {
if (v == SEQ_START_TOKEN) {
seq_printf(seq,
"%3s %6s "
"%10s %10s %6s %6s\n", "Idx",
......
......@@ -736,14 +736,14 @@ static struct sock *raw_get_idx(struct seq_file *seq, loff_t pos)
static void *raw_seq_start(struct seq_file *seq, loff_t *pos)
{
read_lock(&raw_v4_lock);
return *pos ? raw_get_idx(seq, *pos) : (void *)1;
return *pos ? raw_get_idx(seq, *pos) : SEQ_START_TOKEN;
}
static void *raw_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
struct sock *sk;
if (v == (void *)1)
if (v == SEQ_START_TOKEN)
sk = raw_get_first(seq);
else
sk = raw_get_next(seq, v);
......@@ -778,7 +778,7 @@ static int raw_seq_show(struct seq_file *seq, void *v)
{
char tmpbuf[129];
if (v == (void *)1)
if (v == SEQ_START_TOKEN)
seq_printf(seq, "%-127s\n",
" sl local_address rem_address st tx_queue "
"rx_queue tr tm->when retrnsmt uid timeout "
......
......@@ -259,14 +259,14 @@ static struct rtable *rt_cache_get_idx(struct seq_file *seq, loff_t pos)
static void *rt_cache_seq_start(struct seq_file *seq, loff_t *pos)
{
return *pos ? rt_cache_get_idx(seq, *pos) : (void *)1;
return *pos ? rt_cache_get_idx(seq, *pos) : SEQ_START_TOKEN;
}
static void *rt_cache_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
struct rtable *r = NULL;
if (v == (void *)1)
if (v == SEQ_START_TOKEN)
r = rt_cache_get_first(seq);
else
r = rt_cache_get_next(seq, v);
......@@ -276,13 +276,13 @@ static void *rt_cache_seq_next(struct seq_file *seq, void *v, loff_t *pos)
static void rt_cache_seq_stop(struct seq_file *seq, void *v)
{
if (v && v != (void *)1)
if (v && v != SEQ_START_TOKEN)
rcu_read_unlock();
}
static int rt_cache_seq_show(struct seq_file *seq, void *v)
{
if (v == (void *)1)
if (v == SEQ_START_TOKEN)
seq_printf(seq, "%-127s\n",
"Iface\tDestination\tGateway \tFlags\t\tRefCnt\tUse\t"
"Metric\tSource\t\tMTU\tWindow\tIRTT\tTOS\tHHRef\t"
......
......@@ -2351,7 +2351,7 @@ static void *tcp_get_idx(struct seq_file *seq, loff_t pos)
static void *tcp_seq_start(struct seq_file *seq, loff_t *pos)
{
return *pos ? tcp_get_idx(seq, *pos - 1) : (void *)1;
return *pos ? tcp_get_idx(seq, *pos - 1) : SEQ_START_TOKEN;
}
static void *tcp_seq_next(struct seq_file *seq, void *v, loff_t *pos)
......@@ -2359,7 +2359,7 @@ static void *tcp_seq_next(struct seq_file *seq, void *v, loff_t *pos)
void *rc = NULL;
struct tcp_iter_state* st;
if (v == (void *)1) {
if (v == SEQ_START_TOKEN) {
rc = tcp_get_idx(seq, 0);
goto out;
}
......@@ -2397,7 +2397,7 @@ static void tcp_seq_stop(struct seq_file *seq, void *v)
read_unlock_bh(&tp->syn_wait_lock);
}
case TCP_SEQ_STATE_LISTENING:
if (v != (void *)1)
if (v != SEQ_START_TOKEN)
tcp_listen_unlock();
break;
case TCP_SEQ_STATE_TIME_WAIT:
......@@ -2559,7 +2559,7 @@ static int tcp4_seq_show(struct seq_file *seq, void *v)
struct tcp_iter_state* st;
char tmpbuf[TMPSZ + 1];
if (v == (void *)1) {
if (v == SEQ_START_TOKEN) {
seq_printf(seq, "%-*s\n", TMPSZ - 1,
" sl local_address rem_address st tx_queue "
"rx_queue tr tm->when retrnsmt uid timeout "
......
......@@ -1497,7 +1497,7 @@ static void udp4_format_sock(struct sock *sp, char *tmpbuf, int bucket)
static int udp4_seq_show(struct seq_file *seq, void *v)
{
if (v == (void *)1)
if (v == SEQ_START_TOKEN)
seq_printf(seq, "%-127s\n",
" sl local_address rem_address st tx_queue "
"rx_queue tr tm->when retrnsmt uid timeout "
......
......@@ -2170,7 +2170,7 @@ static inline struct inet6_ifaddr *if6_get_bucket(struct seq_file *seq, loff_t *
static void *if6_seq_start(struct seq_file *seq, loff_t *pos)
{
read_lock_bh(&addrconf_hash_lock);
return *pos ? if6_get_bucket(seq, pos) : (void *)1;
return *pos ? if6_get_bucket(seq, pos) : SEQ_START_TOKEN;
}
static void *if6_seq_next(struct seq_file *seq, void *v, loff_t *pos)
......@@ -2178,7 +2178,7 @@ static void *if6_seq_next(struct seq_file *seq, void *v, loff_t *pos)
struct inet6_ifaddr *ifa;
struct if6_iter_state *state;
if (v == (void *)1) {
if (v == SEQ_START_TOKEN) {
ifa = if6_get_bucket(seq, pos);
goto out;
}
......@@ -2214,7 +2214,7 @@ static inline void if6_iface_seq_show(struct seq_file *seq, struct inet6_ifaddr
static int if6_seq_show(struct seq_file *seq, void *v)
{
if (v == (void *)1)
if (v == SEQ_START_TOKEN)
return 0;
else
if6_iface_seq_show(seq, v);
......
......@@ -603,14 +603,14 @@ static struct ip6_flowlabel *ip6fl_get_idx(struct seq_file *seq, loff_t pos)
static void *ip6fl_seq_start(struct seq_file *seq, loff_t *pos)
{
read_lock_bh(&ip6_fl_lock);
return *pos ? ip6fl_get_idx(seq, *pos) : (void *)1;
return *pos ? ip6fl_get_idx(seq, *pos) : SEQ_START_TOKEN;
}
static void *ip6fl_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
struct ip6_flowlabel *fl;
if (v == (void *)1)
if (v == SEQ_START_TOKEN)
fl = ip6fl_get_first(seq);
else
fl = ip6fl_get_next(seq, v);
......@@ -644,7 +644,7 @@ static void ip6fl_fl_seq_show(struct seq_file *seq, struct ip6_flowlabel *fl)
static int ip6fl_seq_show(struct seq_file *seq, void *v)
{
if (v == (void *)1)
if (v == SEQ_START_TOKEN)
seq_printf(seq, "Label S Owner Users Linger Expires "
"Dst Opt\n");
else
......
......@@ -2278,13 +2278,13 @@ static struct ip6_sf_list *igmp6_mcf_get_idx(struct seq_file *seq, loff_t pos)
static void *igmp6_mcf_seq_start(struct seq_file *seq, loff_t *pos)
{
read_lock(&dev_base_lock);
return *pos ? igmp6_mcf_get_idx(seq, *pos) : (void *)1;
return *pos ? igmp6_mcf_get_idx(seq, *pos) : SEQ_START_TOKEN;
}
static void *igmp6_mcf_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
struct ip6_sf_list *psf;
if (v == (void *)1)
if (v == SEQ_START_TOKEN)
psf = igmp6_mcf_get_first(seq);
else
psf = igmp6_mcf_get_next(seq, v);
......@@ -2313,7 +2313,7 @@ static int igmp6_mcf_seq_show(struct seq_file *seq, void *v)
struct ip6_sf_list *psf = (struct ip6_sf_list *)v;
struct igmp6_mcf_iter_state *state = igmp6_mcf_seq_private(seq);
if (v == (void *)1) {
if (v == SEQ_START_TOKEN) {
seq_printf(seq,
"%3s %6s "
"%32s %32s %6s %6s\n", "Idx",
......
......@@ -961,14 +961,14 @@ static struct sock *raw6_get_idx(struct seq_file *seq, loff_t pos)
static void *raw6_seq_start(struct seq_file *seq, loff_t *pos)
{
read_lock(&raw_v6_lock);
return *pos ? raw6_get_idx(seq, *pos) : (void *)1;
return *pos ? raw6_get_idx(seq, *pos) : SEQ_START_TOKEN;
}
static void *raw6_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
struct sock *sk;
if (v == (void *)1)
if (v == SEQ_START_TOKEN)
sk = raw6_get_first(seq);
else
sk = raw6_get_next(seq, v);
......@@ -1010,7 +1010,7 @@ static void raw6_sock_seq_show(struct seq_file *seq, struct sock *sp, int i)
static int raw6_seq_show(struct seq_file *seq, void *v)
{
if (v == (void *)1)
if (v == SEQ_START_TOKEN)
seq_printf(seq,
" sl "
"local_address "
......
......@@ -2027,7 +2027,7 @@ static int tcp6_seq_show(struct seq_file *seq, void *v)
{
struct tcp_iter_state *st;
if (v == (void *)1) {
if (v == SEQ_START_TOKEN) {
seq_printf(seq,
" sl "
"local_address "
......
......@@ -1113,7 +1113,7 @@ static void udp6_sock_seq_show(struct seq_file *seq, struct sock *sp, int bucket
static int udp6_seq_show(struct seq_file *seq, void *v)
{
if (v == (void *)1)
if (v == SEQ_START_TOKEN)
seq_printf(seq,
" sl "
"local_address "
......
......@@ -39,7 +39,7 @@ static void *ipx_seq_interface_start(struct seq_file *seq, loff_t *pos)
loff_t l = *pos;
spin_lock_bh(&ipx_interfaces_lock);
return l ? ipx_get_interface_idx(--l) : (void *)1;
return l ? ipx_get_interface_idx(--l) : SEQ_START_TOKEN;
}
static void *ipx_seq_interface_next(struct seq_file *seq, void *v, loff_t *pos)
......@@ -47,7 +47,7 @@ static void *ipx_seq_interface_next(struct seq_file *seq, void *v, loff_t *pos)
struct ipx_interface *i;
++*pos;
if (v == (void *)1)
if (v == SEQ_START_TOKEN)
i = ipx_interfaces_head();
else
i = ipx_interfaces_next(v);
......@@ -63,7 +63,7 @@ static int ipx_seq_interface_show(struct seq_file *seq, void *v)
{
struct ipx_interface *i;
if (v == (void *)1) {
if (v == SEQ_START_TOKEN) {
seq_puts(seq, "Network Node_Address Primary Device "
"Frame_Type");
#ifdef IPX_REFCNT_DEBUG
......@@ -123,7 +123,7 @@ static void *ipx_seq_route_start(struct seq_file *seq, loff_t *pos)
{
loff_t l = *pos;
read_lock_bh(&ipx_routes_lock);
return l ? ipx_get_route_idx(--l) : (void *)1;
return l ? ipx_get_route_idx(--l) : SEQ_START_TOKEN;
}
static void *ipx_seq_route_next(struct seq_file *seq, void *v, loff_t *pos)
......@@ -131,7 +131,7 @@ static void *ipx_seq_route_next(struct seq_file *seq, void *v, loff_t *pos)
struct ipx_route *r;
++*pos;
if (v == (void *)1)
if (v == SEQ_START_TOKEN)
r = ipx_routes_head();
else
r = ipx_routes_next(v);
......@@ -147,7 +147,7 @@ static int ipx_seq_route_show(struct seq_file *seq, void *v)
{
struct ipx_route *rt;
if (v == (void *)1) {
if (v == SEQ_START_TOKEN) {
seq_puts(seq, "Network Router_Net Router_Node\n");
goto out;
}
......@@ -195,7 +195,7 @@ static void *ipx_seq_socket_start(struct seq_file *seq, loff_t *pos)
loff_t l = *pos;
spin_lock_bh(&ipx_interfaces_lock);
return l ? ipx_get_socket_idx(--l) : (void *)1;
return l ? ipx_get_socket_idx(--l) : SEQ_START_TOKEN;
}
static void *ipx_seq_socket_next(struct seq_file *seq, void *v, loff_t *pos)
......@@ -205,7 +205,7 @@ static void *ipx_seq_socket_next(struct seq_file *seq, void *v, loff_t *pos)
struct ipx_opt *ipxs;
++*pos;
if (v == (void *)1) {
if (v == SEQ_START_TOKEN) {
sk = NULL;
i = ipx_interfaces_head();
if (!i)
......@@ -245,7 +245,7 @@ static int ipx_seq_socket_show(struct seq_file *seq, void *v)
struct sock *s;
struct ipx_opt *ipxs;
if (v == (void *)1) {
if (v == SEQ_START_TOKEN) {
#ifdef CONFIG_IPX_INTERN
seq_puts(seq, "Local_Address "
"Remote_Address Tx_Queue "
......
......@@ -1068,7 +1068,6 @@ int irlan_extract_param(__u8 *buf, char *name, char *value, __u16 *len)
}
#ifdef CONFIG_PROC_FS
#define IRLAN_PROC_START_TOKEN ((void *)1)
/*
* Start of reading /proc entries.
......@@ -1083,7 +1082,7 @@ static void *irlan_seq_start(struct seq_file *seq, loff_t *pos)
rcu_read_lock();
if (*pos == 0)
return IRLAN_PROC_START_TOKEN;
return SEQ_START_TOKEN;
list_for_each_entry(self, &irlans, dev_list) {
if (*pos == i)
......@@ -1099,7 +1098,7 @@ static void *irlan_seq_next(struct seq_file *seq, void *v, loff_t *pos)
struct list_head *nxt;
++*pos;
if (v == IRLAN_PROC_START_TOKEN)
if (v == SEQ_START_TOKEN)
nxt = irlans.next;
else
nxt = ((struct irlan_cb *)v)->dev_list.next;
......@@ -1120,7 +1119,7 @@ static void irlan_seq_stop(struct seq_file *seq, void *v)
*/
static int irlan_seq_show(struct seq_file *seq, void *v)
{
if (v == IRLAN_PROC_START_TOKEN)
if (v == SEQ_START_TOKEN)
seq_puts(seq, "IrLAN instances:\n");
else {
struct irlan_cb *self = v;
......
......@@ -67,7 +67,7 @@ static void *llc_seq_start(struct seq_file *seq, loff_t *pos)
loff_t l = *pos;
read_lock_bh(&llc_main_station.sap_list.lock);
return l ? llc_get_sk_idx(--l) : (void *)1;
return l ? llc_get_sk_idx(--l) : SEQ_START_TOKEN;
}
static void *llc_seq_next(struct seq_file *seq, void *v, loff_t *pos)
......@@ -77,7 +77,7 @@ static void *llc_seq_next(struct seq_file *seq, void *v, loff_t *pos)
struct llc_sap *sap;
++*pos;
if (v == (void *)1) {
if (v == SEQ_START_TOKEN) {
sk = llc_get_sk_idx(0);
goto out;
}
......@@ -123,7 +123,7 @@ static int llc_seq_socket_show(struct seq_file *seq, void *v)
struct sock* sk;
struct llc_opt *llc;
if (v == (void *)1) {
if (v == SEQ_START_TOKEN) {
seq_puts(seq, "SKt Mc local_mac_sap remote_mac_sap "
" tx_queue rx_queue st uid link\n");
goto out;
......@@ -172,7 +172,7 @@ static int llc_seq_core_show(struct seq_file *seq, void *v)
struct sock* sk;
struct llc_opt *llc;
if (v == (void *)1) {
if (v == SEQ_START_TOKEN) {
seq_puts(seq, "Connection list:\n"
"dsap state retr txw rxw pf ff sf df rs cs "
"tack tpfc trs tbs blog busr\n");
......
......@@ -1241,8 +1241,6 @@ static int nr_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
#ifdef CONFIG_PROC_FS
/* Marker for header entry */
#define NETROM_PROC_START ((void *)1)
static void *nr_info_start(struct seq_file *seq, loff_t *pos)
{
struct sock *s;
......@@ -1251,7 +1249,7 @@ static void *nr_info_start(struct seq_file *seq, loff_t *pos)
spin_lock_bh(&nr_list_lock);
if (*pos == 0)
return NETROM_PROC_START;
return SEQ_START_TOKEN;
sk_for_each(s, node, &nr_list) {
if (i == *pos)
......@@ -1265,7 +1263,7 @@ static void *nr_info_next(struct seq_file *seq, void *v, loff_t *pos)
{
++*pos;
return (v == NETROM_PROC_START) ? sk_head(&nr_list)
return (v == SEQ_START_TOKEN) ? sk_head(&nr_list)
: sk_next((struct sock *)v);
}
......@@ -1281,7 +1279,7 @@ static int nr_info_show(struct seq_file *seq, void *v)
nr_cb *nr;
const char *devname;
if (v == NETROM_PROC_START)
if (v == SEQ_START_TOKEN)
seq_puts(seq,
"user_addr dest_node src_node dev my your st vs vr va t1 t2 t4 idle n2 wnd Snd-Q Rcv-Q inode\n");
......
......@@ -841,7 +841,6 @@ int nr_route_frame(struct sk_buff *skb, ax25_cb *ax25)
}
#ifdef CONFIG_PROC_FS
#define NETROM_PROC_START ((void *) 1)
static void *nr_node_start(struct seq_file *seq, loff_t *pos)
{
......@@ -851,7 +850,7 @@ static void *nr_node_start(struct seq_file *seq, loff_t *pos)
spin_lock_bh(&nr_node_list_lock);
if (*pos == 0)
return NETROM_PROC_START;
return SEQ_START_TOKEN;
nr_node_for_each(nr_node, node, &nr_node_list) {
if (i == *pos)
......@@ -867,7 +866,7 @@ static void *nr_node_next(struct seq_file *seq, void *v, loff_t *pos)
struct hlist_node *node;
++*pos;
node = (v == NETROM_PROC_START)
node = (v == SEQ_START_TOKEN)
? nr_node_list.first
: ((struct nr_node *)v)->node_node.next;
......@@ -883,7 +882,7 @@ static int nr_node_show(struct seq_file *seq, void *v)
{
int i;
if (v == NETROM_PROC_START)
if (v == SEQ_START_TOKEN)
seq_puts(seq,
"callsign mnemonic w n qual obs neigh qual obs neigh qual obs neigh\n");
else {
......@@ -936,7 +935,7 @@ static void *nr_neigh_start(struct seq_file *seq, loff_t *pos)
spin_lock_bh(&nr_neigh_list_lock);
if (*pos == 0)
return NETROM_PROC_START;
return SEQ_START_TOKEN;
nr_neigh_for_each(nr_neigh, node, &nr_neigh_list) {
if (i == *pos)
......@@ -950,7 +949,7 @@ static void *nr_neigh_next(struct seq_file *seq, void *v, loff_t *pos)
struct hlist_node *node;
++*pos;
node = (v == NETROM_PROC_START)
node = (v == SEQ_START_TOKEN)
? nr_neigh_list.first
: ((struct nr_neigh *)v)->neigh_node.next;
......@@ -966,7 +965,7 @@ static int nr_neigh_show(struct seq_file *seq, void *v)
{
int i;
if (v == NETROM_PROC_START)
if (v == SEQ_START_TOKEN)
seq_puts(seq, "addr callsign dev qual lock count failed digipeaters\n");
else {
struct nr_neigh *nr_neigh = v;
......
......@@ -1344,7 +1344,7 @@ static void *rose_info_start(struct seq_file *seq, loff_t *pos)
spin_lock_bh(&rose_list_lock);
if (*pos == 0)
return ROSE_PROC_START;
return SEQ_START_TOKEN;
i = 1;
sk_for_each(s, node, &rose_list) {
......@@ -1359,7 +1359,7 @@ static void *rose_info_next(struct seq_file *seq, void *v, loff_t *pos)
{
++*pos;
return (v == ROSE_PROC_START) ? sk_head(&rose_list)
return (v == SEQ_START_TOKEN) ? sk_head(&rose_list)
: sk_next((struct sock *)v);
}
......@@ -1370,7 +1370,7 @@ static void rose_info_stop(struct seq_file *seq, void *v)
static int rose_info_show(struct seq_file *seq, void *v)
{
if (v == ROSE_PROC_START)
if (v == SEQ_START_TOKEN)
seq_puts(seq,
"dest_addr dest_call src_addr src_call dev lci neigh st vs vr va t t1 t2 t3 hb idle Snd-Q Rcv-Q inode\n");
......
......@@ -1076,7 +1076,7 @@ static void *rose_node_start(struct seq_file *seq, loff_t *pos)
spin_lock_bh(&rose_neigh_list_lock);
if (*pos == 0)
return ROSE_PROC_START;
return SEQ_START_TOKEN;
for (rose_node = rose_node_list; rose_node && i < *pos;
rose_node = rose_node->next, ++i);
......@@ -1088,7 +1088,7 @@ static void *rose_node_next(struct seq_file *seq, void *v, loff_t *pos)
{
++*pos;
return (v == ROSE_PROC_START) ? rose_node_list
return (v == SEQ_START_TOKEN) ? rose_node_list
: ((struct rose_node *)v)->next;
}
......@@ -1101,7 +1101,7 @@ static int rose_node_show(struct seq_file *seq, void *v)
{
int i;
if (v == ROSE_PROC_START)
if (v == SEQ_START_TOKEN)
seq_puts(seq, "address mask n neigh neigh neigh\n");
else {
const struct rose_node *rose_node = v;
......@@ -1152,7 +1152,7 @@ static void *rose_neigh_start(struct seq_file *seq, loff_t *pos)
spin_lock_bh(&rose_neigh_list_lock);
if (*pos == 0)
return ROSE_PROC_START;
return SEQ_START_TOKEN;
for (rose_neigh = rose_neigh_list; rose_neigh && i < *pos;
rose_neigh = rose_neigh->next, ++i);
......@@ -1164,7 +1164,7 @@ static void *rose_neigh_next(struct seq_file *seq, void *v, loff_t *pos)
{
++*pos;
return (v == ROSE_PROC_START) ? rose_neigh_list
return (v == SEQ_START_TOKEN) ? rose_neigh_list
: ((struct rose_neigh *)v)->next;
}
......@@ -1177,7 +1177,7 @@ static int rose_neigh_show(struct seq_file *seq, void *v)
{
int i;
if (v == ROSE_PROC_START)
if (v == SEQ_START_TOKEN)
seq_puts(seq,
"addr callsign dev count use mode restart t0 tf digipeaters\n");
else {
......@@ -1234,7 +1234,7 @@ static void *rose_route_start(struct seq_file *seq, loff_t *pos)
spin_lock_bh(&rose_route_list_lock);
if (*pos == 0)
return ROSE_PROC_START;
return SEQ_START_TOKEN;
for (rose_route = rose_route_list; rose_route && i < *pos;
rose_route = rose_route->next, ++i);
......@@ -1246,7 +1246,7 @@ static void *rose_route_next(struct seq_file *seq, void *v, loff_t *pos)
{
++*pos;
return (v == ROSE_PROC_START) ? rose_route_list
return (v == SEQ_START_TOKEN) ? rose_route_list
: ((struct rose_route *)v)->next;
}
......@@ -1257,7 +1257,7 @@ static void rose_route_stop(struct seq_file *seq, void *v)
static int rose_route_show(struct seq_file *seq, void *v)
{
if (v == ROSE_PROC_START)
if (v == SEQ_START_TOKEN)
seq_puts(seq,
"lci address callsign neigh <-> lci address callsign neigh\n");
else {
......
......@@ -1035,7 +1035,7 @@ static void *c_start(struct seq_file *m, loff_t *pos)
read_lock(&cd->hash_lock);
if (!n--)
return (void *)1;
return SEQ_START_TOKEN;
hash = n >> 32;
entry = n & ((1LL<<32) - 1);
......@@ -1060,7 +1060,7 @@ static void *c_next(struct seq_file *m, void *p, loff_t *pos)
int hash = (*pos >> 32);
struct cache_detail *cd = ((struct handle*)m->private)->cd;
if (p == (void *)1)
if (p == SEQ_START_TOKEN)
hash = 0;
else if (ch->next == NULL) {
hash++;
......@@ -1092,7 +1092,7 @@ static int c_show(struct seq_file *m, void *p)
struct cache_head *cp = p;
struct cache_detail *cd = ((struct handle*)m->private)->cd;
if (p == (void *)1)
if (p == SEQ_START_TOKEN)
return cd->cache_show(m, cd, NULL);
ifdebug(CACHE)
......
......@@ -86,7 +86,7 @@ static void *r_start(struct seq_file *m, loff_t *pos)
lock_kernel();
if (!l--)
return (void *)1;
return SEQ_START_TOKEN;
for (wandev = wanrouter_router_devlist; l-- && wandev;
wandev = wandev->next)
;
......@@ -97,7 +97,7 @@ static void *r_next(struct seq_file *m, void *v, loff_t *pos)
{
struct wan_device *wandev = v;
(*pos)++;
return (v == (void *)1) ? wanrouter_router_devlist : wandev->next;
return (v == SEQ_START_TOKEN) ? wanrouter_router_devlist : wandev->next;
}
static void r_stop(struct seq_file *m, void *v)
......@@ -108,7 +108,7 @@ static void r_stop(struct seq_file *m, void *v)
static int config_show(struct seq_file *m, void *v)
{
struct wan_device *p = v;
if (v == (void *)1) {
if (v == SEQ_START_TOKEN) {
seq_puts(m, "Device name | port |IRQ|DMA| mem.addr |"
"mem.size|option1|option2|option3|option4\n");
return 0;
......@@ -124,7 +124,7 @@ static int config_show(struct seq_file *m, void *v)
static int status_show(struct seq_file *m, void *v)
{
struct wan_device *p = v;
if (v == (void *)1) {
if (v == SEQ_START_TOKEN) {
seq_puts(m, "Device name |protocol|station|interface|"
"clocking|baud rate| MTU |ndev|link state\n");
return 0;
......
......@@ -44,7 +44,7 @@ static void *x25_seq_route_start(struct seq_file *seq, loff_t *pos)
loff_t l = *pos;
read_lock_bh(&x25_route_list_lock);
return l ? x25_get_route_idx(--l) : (void *)1;
return l ? x25_get_route_idx(--l) : SEQ_START_TOKEN;
}
static void *x25_seq_route_next(struct seq_file *seq, void *v, loff_t *pos)
......@@ -52,7 +52,7 @@ static void *x25_seq_route_next(struct seq_file *seq, void *v, loff_t *pos)
struct x25_route *rt;
++*pos;
if (v == (void *)1) {
if (v == SEQ_START_TOKEN) {
rt = NULL;
if (!list_empty(&x25_route_list))
rt = list_entry(x25_route_list.next,
......@@ -77,7 +77,7 @@ static int x25_seq_route_show(struct seq_file *seq, void *v)
{
struct x25_route *rt;
if (v == (void *)1) {
if (v == SEQ_START_TOKEN) {
seq_puts(seq, "Address Digits Device\n");
goto out;
}
......@@ -108,7 +108,7 @@ static void *x25_seq_socket_start(struct seq_file *seq, loff_t *pos)
loff_t l = *pos;
read_lock_bh(&x25_list_lock);
return l ? x25_get_socket_idx(--l) : (void *)1;
return l ? x25_get_socket_idx(--l) : SEQ_START_TOKEN;
}
static void *x25_seq_socket_next(struct seq_file *seq, void *v, loff_t *pos)
......@@ -116,7 +116,7 @@ static void *x25_seq_socket_next(struct seq_file *seq, void *v, loff_t *pos)
struct sock *s;
++*pos;
if (v == (void *)1) {
if (v == SEQ_START_TOKEN) {
s = sk_head(&x25_list);
goto out;
}
......@@ -137,7 +137,7 @@ static int x25_seq_socket_show(struct seq_file *seq, void *v)
struct net_device *dev;
const char *devname;
if (v == (void *)1) {
if (v == SEQ_START_TOKEN) {
seq_printf(seq, "dest_addr src_addr dev lci st vs vr "
"va t t2 t21 t22 t23 Snd-Q Rcv-Q inode\n");
goto out;
......
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