atm: clean up vcc_seq_next()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 14 Feb 2019 06:56:35 +0000 (09:56 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sun, 17 Feb 2019 02:12:22 +0000 (18:12 -0800)
It's confusing to call PTR_ERR(v).  The PTR_ERR() function is basically
a fancy cast to long so it makes you wonder, was IS_ERR() intended?  But
that doesn't make sense because vcc_walk() doesn't return error
pointers.

This patch doesn't affect runtime, it's just a cleanup.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/atm/proc.c

index 0b0495a41bbed689ecdd65e014071488397ab90d..d79221fd4dae2e8b13ac0725899a1b26a559db44 100644 (file)
@@ -134,7 +134,8 @@ static void vcc_seq_stop(struct seq_file *seq, void *v)
 static void *vcc_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 {
        v = vcc_walk(seq, 1);
-       *pos += !!PTR_ERR(v);
+       if (v)
+               (*pos)++;
        return v;
 }