Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH] S2io: two branches the same in wait_for_cmd_complete()

0 views
Skip to first unread message

Roel Kluin

unread,
Jan 17, 2010, 10:10:02 AM1/17/10
to
Regardless of the bit_state, the branches execute the same code.

Signed-off-by: Roel Kluin <roel....@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())
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

David Miller

unread,
Jan 17, 2010, 10:20:02 PM1/17/10
to
From: Roel Kluin <roel....@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....@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.

Joe Perches

unread,
Jan 17, 2010, 11:00:01 PM1/17/10
to
On Sun, 2010-01-17 at 19:13 -0800, David Miller wrote:
> From: Roel Kluin <roel....@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....@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>

Ramkrishna Vepa

unread,
Jan 18, 2010, 2:40:01 AM1/18/10
to
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

David Miller

unread,
Jan 19, 2010, 5:10:01 AM1/19/10
to
From: "Ramkrishna Vepa" <Ramkris...@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.

0 new messages