linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] qlge: Move jiffies_to_usecs immediately before loop
@ 2015-05-20  4:44 Joe Perches
  2015-05-20 23:17 ` Harish Patil
  2015-05-21 21:23 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Joe Perches @ 2015-05-20  4:44 UTC (permalink / raw)
  To: Harish Patil, Sudarsana Kalluru
  Cc: Dept-GELinuxNICDev, linux-driver, netdev, linux-kernel

30 usecs (or really, 1 jiffy) can go by pretty fast.

Move the set of the timeout immediately before the loop.

Remove the unnecessary max(1ul, usecs_to_jiffies(30)) as
usecs_to_jiffies with a non-zero constant is guaranteed
to be non-zero.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/ethernet/qlogic/qlge/qlge_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
index 25800a1..02b7115 100644
--- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c
+++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
@@ -3871,9 +3871,6 @@ static int ql_adapter_reset(struct ql_adapter *qdev)
 		return status;
 	}
 
-	end_jiffies = jiffies +
-		max((unsigned long)1, usecs_to_jiffies(30));
-
 	/* Check if bit is set then skip the mailbox command and
 	 * clear the bit, else we are in normal reset process.
 	 */
@@ -3888,6 +3885,7 @@ static int ql_adapter_reset(struct ql_adapter *qdev)
 
 	ql_write32(qdev, RST_FO, (RST_FO_FR << 16) | RST_FO_FR);
 
+	end_jiffies = jiffies + usecs_to_jiffies(30);
 	do {
 		value = ql_read32(qdev, RST_FO);
 		if ((value & RST_FO_FR) == 0)



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

* Re: [PATCH] qlge: Move jiffies_to_usecs immediately before loop
  2015-05-20  4:44 [PATCH] qlge: Move jiffies_to_usecs immediately before loop Joe Perches
@ 2015-05-20 23:17 ` Harish Patil
  2015-05-21 21:23 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Harish Patil @ 2015-05-20 23:17 UTC (permalink / raw)
  To: Joe Perches, Sudarsana Kalluru
  Cc: Dept-GE Linux NIC Dev, Dept-Eng Linux Driver, netdev, linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1463 bytes --]

>
>30 usecs (or really, 1 jiffy) can go by pretty fast.
>
>Move the set of the timeout immediately before the loop.
>
>Remove the unnecessary max(1ul, usecs_to_jiffies(30)) as
>usecs_to_jiffies with a non-zero constant is guaranteed
>to be non-zero.
>
>Signed-off-by: Joe Perches <joe@perches.com>
>---
> drivers/net/ethernet/qlogic/qlge/qlge_main.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
>diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c
>b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
>index 25800a1..02b7115 100644
>--- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c
>+++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
>@@ -3871,9 +3871,6 @@ static int ql_adapter_reset(struct ql_adapter *qdev)
> 		return status;
> 	}
> 
>-	end_jiffies = jiffies +
>-		max((unsigned long)1, usecs_to_jiffies(30));
>-
> 	/* Check if bit is set then skip the mailbox command and
> 	 * clear the bit, else we are in normal reset process.
> 	 */
>@@ -3888,6 +3885,7 @@ static int ql_adapter_reset(struct ql_adapter *qdev)
> 
> 	ql_write32(qdev, RST_FO, (RST_FO_FR << 16) | RST_FO_FR);
> 
>+	end_jiffies = jiffies + usecs_to_jiffies(30);
> 	do {
> 		value = ql_read32(qdev, RST_FO);
> 		if ((value & RST_FO_FR) == 0)
>
>
>

Acked-by: Harish Patil <harish.patil@qlogic.com>


Thanks,
Harish

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* Re: [PATCH] qlge: Move jiffies_to_usecs immediately before loop
  2015-05-20  4:44 [PATCH] qlge: Move jiffies_to_usecs immediately before loop Joe Perches
  2015-05-20 23:17 ` Harish Patil
@ 2015-05-21 21:23 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2015-05-21 21:23 UTC (permalink / raw)
  To: joe
  Cc: harish.patil, sudarsana.kalluru, Dept-GELinuxNICDev,
	linux-driver, netdev, linux-kernel

From: Joe Perches <joe@perches.com>
Date: Tue, 19 May 2015 21:44:52 -0700

> 30 usecs (or really, 1 jiffy) can go by pretty fast.
> 
> Move the set of the timeout immediately before the loop.
> 
> Remove the unnecessary max(1ul, usecs_to_jiffies(30)) as
> usecs_to_jiffies with a non-zero constant is guaranteed
> to be non-zero.
> 
> Signed-off-by: Joe Perches <joe@perches.com>

This looks fine, applied to net-next, thanks Joe.

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

end of thread, other threads:[~2015-05-21 21:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-20  4:44 [PATCH] qlge: Move jiffies_to_usecs immediately before loop Joe Perches
2015-05-20 23:17 ` Harish Patil
2015-05-21 21:23 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).