Skip to content

Commit

Permalink
[AF_UNIX]: Use SEQ_START_TOKEN
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Joe Perches authored and David S. Miller committed Apr 13, 2008
1 parent 1a41879 commit b9f3124
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/unix/af_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -2037,7 +2037,7 @@ static void *unix_seq_start(struct seq_file *seq, loff_t *pos)
__acquires(unix_table_lock)
{
spin_lock(&unix_table_lock);
return *pos ? unix_seq_idx(seq, *pos - 1) : ((void *) 1);
return *pos ? unix_seq_idx(seq, *pos - 1) : SEQ_START_TOKEN;
}

static void *unix_seq_next(struct seq_file *seq, void *v, loff_t *pos)
Expand All @@ -2046,7 +2046,7 @@ static void *unix_seq_next(struct seq_file *seq, void *v, loff_t *pos)
struct sock *sk = v;
++*pos;

if (v == (void *)1)
if (v == SEQ_START_TOKEN)
sk = first_unix_socket(&iter->i);
else
sk = next_unix_socket(&iter->i, sk);
Expand All @@ -2064,7 +2064,7 @@ static void unix_seq_stop(struct seq_file *seq, void *v)
static int unix_seq_show(struct seq_file *seq, void *v)
{

if (v == (void *)1)
if (v == SEQ_START_TOKEN)
seq_puts(seq, "Num RefCount Protocol Flags Type St "
"Inode Path\n");
else {
Expand Down

0 comments on commit b9f3124

Please sign in to comment.