All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sh_eth: fix result of sh_eth_check_reset() on timeout
@ 2013-06-05 19:54 ` Sergei Shtylyov
  0 siblings, 0 replies; 4+ messages in thread
From: Sergei Shtylyov @ 2013-06-05 19:54 UTC (permalink / raw)
  To: netdev; +Cc: nobuhiro.iwamatsu.yj, linux-sh

When  the first loop in sh_eth_check_reset() runs to its end, 'cnt' is 0, so the
following check for 'cnt < 0' fails to catch the timeout.  Fix the  condition in
this check, so that the timeout  is actually reported.
While at it, fix the grammar in the failure message...

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
The patch is against the David Miller's 'net.git' repo.
Dave, since this is fixing the failure case, I don't think it's needed in
-stable...

 drivers/net/ethernet/renesas/sh_eth.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: net/drivers/net/ethernet/renesas/sh_eth.c
=================================--- net.orig/drivers/net/ethernet/renesas/sh_eth.c
+++ net/drivers/net/ethernet/renesas/sh_eth.c
@@ -897,8 +897,8 @@ static int sh_eth_check_reset(struct net
 		mdelay(1);
 		cnt--;
 	}
-	if (cnt < 0) {
-		pr_err("Device reset fail\n");
+	if (cnt <= 0) {
+		pr_err("Device reset failed\n");
 		ret = -ETIMEDOUT;
 	}
 	return ret;

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

* [PATCH] sh_eth: fix result of sh_eth_check_reset() on timeout
@ 2013-06-05 19:54 ` Sergei Shtylyov
  0 siblings, 0 replies; 4+ messages in thread
From: Sergei Shtylyov @ 2013-06-05 19:54 UTC (permalink / raw)
  To: netdev; +Cc: nobuhiro.iwamatsu.yj, linux-sh

When  the first loop in sh_eth_check_reset() runs to its end, 'cnt' is 0, so the
following check for 'cnt < 0' fails to catch the timeout.  Fix the  condition in
this check, so that the timeout  is actually reported.
While at it, fix the grammar in the failure message...

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
The patch is against the David Miller's 'net.git' repo.
Dave, since this is fixing the failure case, I don't think it's needed in
-stable...

 drivers/net/ethernet/renesas/sh_eth.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: net/drivers/net/ethernet/renesas/sh_eth.c
===================================================================
--- net.orig/drivers/net/ethernet/renesas/sh_eth.c
+++ net/drivers/net/ethernet/renesas/sh_eth.c
@@ -897,8 +897,8 @@ static int sh_eth_check_reset(struct net
 		mdelay(1);
 		cnt--;
 	}
-	if (cnt < 0) {
-		pr_err("Device reset fail\n");
+	if (cnt <= 0) {
+		pr_err("Device reset failed\n");
 		ret = -ETIMEDOUT;
 	}
 	return ret;

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

* Re: [PATCH] sh_eth: fix result of sh_eth_check_reset() on timeout
  2013-06-05 19:54 ` Sergei Shtylyov
@ 2013-06-11  9:29   ` David Miller
  -1 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2013-06-11  9:29 UTC (permalink / raw)
  To: sergei.shtylyov; +Cc: netdev, nobuhiro.iwamatsu.yj, linux-sh

From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Wed, 5 Jun 2013 23:54:01 +0400

> When  the first loop in sh_eth_check_reset() runs to its end, 'cnt' is 0, so the
> following check for 'cnt < 0' fails to catch the timeout.  Fix the  condition in
> this check, so that the timeout  is actually reported.
> While at it, fix the grammar in the failure message...
> 
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Applied.

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

* Re: [PATCH] sh_eth: fix result of sh_eth_check_reset() on timeout
@ 2013-06-11  9:29   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2013-06-11  9:29 UTC (permalink / raw)
  To: sergei.shtylyov; +Cc: netdev, nobuhiro.iwamatsu.yj, linux-sh

From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Wed, 5 Jun 2013 23:54:01 +0400

> When  the first loop in sh_eth_check_reset() runs to its end, 'cnt' is 0, so the
> following check for 'cnt < 0' fails to catch the timeout.  Fix the  condition in
> this check, so that the timeout  is actually reported.
> While at it, fix the grammar in the failure message...
> 
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Applied.

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

end of thread, other threads:[~2013-06-11  9:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-05 19:54 [PATCH] sh_eth: fix result of sh_eth_check_reset() on timeout Sergei Shtylyov
2013-06-05 19:54 ` Sergei Shtylyov
2013-06-11  9:29 ` David Miller
2013-06-11  9:29   ` 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.