All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] atm: clean up vcc_seq_next()
@ 2019-02-14  6:56 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2019-02-14  6:56 UTC (permalink / raw)
  To: David S. Miller; +Cc: Joe Perches, netdev, kernel-janitors

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>
---
 net/atm/proc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/atm/proc.c b/net/atm/proc.c
index 0b0495a41bbe..d79221fd4dae 100644
--- a/net/atm/proc.c
+++ b/net/atm/proc.c
@@ -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;
 }
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] atm: clean up vcc_seq_next()
@ 2019-02-14  6:56 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2019-02-14  6:56 UTC (permalink / raw)
  To: David S. Miller; +Cc: Joe Perches, netdev, kernel-janitors

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>
---
 net/atm/proc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/atm/proc.c b/net/atm/proc.c
index 0b0495a41bbe..d79221fd4dae 100644
--- a/net/atm/proc.c
+++ b/net/atm/proc.c
@@ -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;
 }
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] atm: clean up vcc_seq_next()
  2019-02-14  6:56 ` Dan Carpenter
@ 2019-02-17  2:14   ` David Miller
  -1 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2019-02-17  2:14 UTC (permalink / raw)
  To: dan.carpenter; +Cc: joe, netdev, kernel-janitors

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu, 14 Feb 2019 09:56:35 +0300

> 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>

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] atm: clean up vcc_seq_next()
@ 2019-02-17  2:14   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2019-02-17  2:14 UTC (permalink / raw)
  To: dan.carpenter; +Cc: joe, netdev, kernel-janitors

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu, 14 Feb 2019 09:56:35 +0300

> 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>

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-02-17  2:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-14  6:56 [PATCH] atm: clean up vcc_seq_next() Dan Carpenter
2019-02-14  6:56 ` Dan Carpenter
2019-02-17  2:14 ` David Miller
2019-02-17  2:14   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.