Commit 32d2e3a1 authored by Li Zefan's avatar Li Zefan Committed by David S. Miller
Browse files

net: x25: use seq_hlist_foo() helpers

Simplify seq_file code.
Signed-off-by: default avatarLi Zefan <>
Signed-off-by: default avatarDavid S. Miller <>
parent c4146644
......@@ -93,40 +93,16 @@ out:
return 0;
static __inline__ struct sock *x25_get_socket_idx(loff_t pos)
struct sock *s;
struct hlist_node *node;
sk_for_each(s, node, &x25_list)
if (!pos--)
goto found;
s = NULL;
return s;
static void *x25_seq_socket_start(struct seq_file *seq, loff_t *pos)
loff_t l = *pos;
return l ? x25_get_socket_idx(--l) : SEQ_START_TOKEN;
return seq_hlist_start_head(&x25_list, *pos);
static void *x25_seq_socket_next(struct seq_file *seq, void *v, loff_t *pos)
struct sock *s;
if (v == SEQ_START_TOKEN) {
s = sk_head(&x25_list);
goto out;
s = sk_next(v);
return s;
return seq_hlist_next(v, &x25_list, pos);
static void x25_seq_socket_stop(struct seq_file *seq, void *v)
......@@ -148,7 +124,7 @@ static int x25_seq_socket_show(struct seq_file *seq, void *v)
goto out;
s = v;
s = sk_entry(v);
x25 = x25_sk(s);
if (!x25->neighbour || (dev = x25->neighbour->dev) == NULL)
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