linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] S2io: two branches the same in wait_for_cmd_complete()
@ 2010-01-17 15:10 Roel Kluin
  2010-01-18  3:13 ` David Miller
  2010-01-18  7:20 ` Ramkrishna Vepa
  0 siblings, 2 replies; 5+ messages in thread
From: Roel Kluin @ 2010-01-17 15:10 UTC (permalink / raw)
  To: netdev, Andrew Morton, LKML, David S. Miller

Regardless of the bit_state, the branches execute the same code.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
 drivers/net/s2io.c |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)

Maybe something else was intended?
this was introduced in commit 9fc93a41a1ad11

diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index cc42186..0e353d6 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -3415,16 +3415,9 @@ static int wait_for_cmd_complete(void __iomem *addr, u64 busy_bit,
 
 	do {
 		val64 = readq(addr);
-		if (bit_state == S2IO_BIT_RESET) {
-			if (!(val64 & busy_bit)) {
-				ret = SUCCESS;
-				break;
-			}
-		} else {
-			if (!(val64 & busy_bit)) {
-				ret = SUCCESS;
-				break;
-			}
+		if (!(val64 & busy_bit)) {
+			ret = SUCCESS;
+			break;
 		}
 
 		if (in_interrupt())

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

* Re: [PATCH] S2io: two branches the same in wait_for_cmd_complete()
  2010-01-17 15:10 [PATCH] S2io: two branches the same in wait_for_cmd_complete() Roel Kluin
@ 2010-01-18  3:13 ` David Miller
  2010-01-18  3:58   ` Joe Perches
  2010-01-18  7:20 ` Ramkrishna Vepa
  1 sibling, 1 reply; 5+ messages in thread
From: David Miller @ 2010-01-18  3:13 UTC (permalink / raw)
  To: roel.kluin
  Cc: netdev, akpm, linux-kernel, sivakumar.subramani, ram.vepa,
	santosh.rastapur, sreenivasa.honnur, anil.murthy

From: Roel Kluin <roel.kluin@gmail.com>
Date: Sun, 17 Jan 2010 16:10:04 +0100

> Regardless of the bit_state, the branches execute the same code.
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
>  drivers/net/s2io.c |   13 +++----------
>  1 files changed, 3 insertions(+), 10 deletions(-)
> 
> Maybe something else was intended?
> this was introduced in commit 9fc93a41a1ad11

If you know the guilty commit, at least do the author(s) of commit
and/or the driver maintainer(s) the courtesy of CC:'ing them on
patches like this.

I've fixed this up here in my reply.

> diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
> index cc42186..0e353d6 100644
> --- a/drivers/net/s2io.c
> +++ b/drivers/net/s2io.c
> @@ -3415,16 +3415,9 @@ static int wait_for_cmd_complete(void __iomem *addr, u64 busy_bit,
>  
>  	do {
>  		val64 = readq(addr);
> -		if (bit_state == S2IO_BIT_RESET) {
> -			if (!(val64 & busy_bit)) {
> -				ret = SUCCESS;
> -				break;
> -			}
> -		} else {
> -			if (!(val64 & busy_bit)) {
> -				ret = SUCCESS;
> -				break;
> -			}
> +		if (!(val64 & busy_bit)) {
> +			ret = SUCCESS;
> +			break;
>  		}
>  
>  		if (in_interrupt())

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

* Re: [PATCH] S2io: two branches the same in wait_for_cmd_complete()
  2010-01-18  3:13 ` David Miller
@ 2010-01-18  3:58   ` Joe Perches
  0 siblings, 0 replies; 5+ messages in thread
From: Joe Perches @ 2010-01-18  3:58 UTC (permalink / raw)
  To: David Miller
  Cc: roel.kluin, netdev, akpm, linux-kernel, sivakumar.subramani,
	ram.vepa, santosh.rastapur, sreenivasa.honnur, anil.murthy

On Sun, 2010-01-17 at 19:13 -0800, David Miller wrote:
> From: Roel Kluin <roel.kluin@gmail.com>
> Date: Sun, 17 Jan 2010 16:10:04 +0100
> > Regardless of the bit_state, the branches execute the same code.
> > Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> > ---
> >  drivers/net/s2io.c |   13 +++----------
> >  1 files changed, 3 insertions(+), 10 deletions(-)
> > Maybe something else was intended?
> > this was introduced in commit 9fc93a41a1ad11
> If you know the guilty commit, at least do the author(s) of commit
> and/or the driver maintainer(s) the courtesy of CC:'ing them on
> patches like this.

One way to do that is to use:
$ ./scripts/get_maintainer.pl --git-blame <patch>



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

* RE: [PATCH] S2io: two branches the same in wait_for_cmd_complete()
  2010-01-17 15:10 [PATCH] S2io: two branches the same in wait_for_cmd_complete() Roel Kluin
  2010-01-18  3:13 ` David Miller
@ 2010-01-18  7:20 ` Ramkrishna Vepa
  2010-01-19  9:59   ` David Miller
  1 sibling, 1 reply; 5+ messages in thread
From: Ramkrishna Vepa @ 2010-01-18  7:20 UTC (permalink / raw)
  To: Roel Kluin, netdev, Andrew Morton, LKML, David S. Miller

> Regardless of the bit_state, the branches execute the same code.
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
>  drivers/net/s2io.c |   13 +++----------
>  1 files changed, 3 insertions(+), 10 deletions(-)
> 
> Maybe something else was intended?
> this was introduced in commit 9fc93a41a1ad11
> 
> diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
> index cc42186..0e353d6 100644
> --- a/drivers/net/s2io.c
> +++ b/drivers/net/s2io.c
> @@ -3415,16 +3415,9 @@ static int wait_for_cmd_complete(void __iomem
> *addr, u64 busy_bit,
> 
>  	do {
>  		val64 = readq(addr);
> -		if (bit_state == S2IO_BIT_RESET) {
> -			if (!(val64 & busy_bit)) {
> -				ret = SUCCESS;
> -				break;
> -			}
> -		} else {
> -			if (!(val64 & busy_bit)) {
> -				ret = SUCCESS;
> -				break;
> -			}
> +		if (!(val64 & busy_bit)) {
> +			ret = SUCCESS;
> +			break;
>  		}
> 
>  		if (in_interrupt())
> --
Thanks for catching this bug. The fix should be as follows -
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -3421,7 +3421,7 @@ static int wait_for_cmd_complete(void __iomem
*addr, u64 busy_bit,
                                break;
                        }
                } else {
-                       if (!(val64 & busy_bit)) {
+                       if (val64 & busy_bit) {
                                ret = SUCCESS;
                                break;
                        }

We've not hit this bug because wait_for_cmd_complete() is always called
with S2IO_BIT_RESET.

Ram

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

* Re: [PATCH] S2io: two branches the same in wait_for_cmd_complete()
  2010-01-18  7:20 ` Ramkrishna Vepa
@ 2010-01-19  9:59   ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2010-01-19  9:59 UTC (permalink / raw)
  To: Ramkrishna.Vepa; +Cc: roel.kluin, netdev, akpm, linux-kernel

From: "Ramkrishna Vepa" <Ramkrishna.Vepa@neterion.com>
Date: Mon, 18 Jan 2010 02:20:06 -0500

> Thanks for catching this bug. The fix should be as follows -

This doesn't apply to net-2.6, and I'd need your signoff too.

Please fix this up and resubmit, thanks.

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

end of thread, other threads:[~2010-01-19  9:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-17 15:10 [PATCH] S2io: two branches the same in wait_for_cmd_complete() Roel Kluin
2010-01-18  3:13 ` David Miller
2010-01-18  3:58   ` Joe Perches
2010-01-18  7:20 ` Ramkrishna Vepa
2010-01-19  9:59   ` 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).