* [PATCH] postfix decrement error in ipw2100_start_adapter(); drivers/net/wireless/ipw2100.c
@ 2007-11-05 0:43 Roel Kluin
2007-11-05 2:50 ` Zhu Yi
2007-11-05 22:55 ` Roel Kluin
0 siblings, 2 replies; 3+ messages in thread
From: Roel Kluin @ 2007-11-05 0:43 UTC (permalink / raw)
To: linux-wireless
If i reaches zero, the loop ends, but the postfix decrement subtracts it to -1.
Testing for 'i == 0', later in the function, will not fulfill its purpose.
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
index a6c7904..84870f4 100644
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -1267,7 +1267,7 @@ static int ipw2100_start_adapter(struct ipw2100_priv *priv)
IPW2100_INTA_FATAL_ERROR |
IPW2100_INTA_PARITY_ERROR);
}
- } while (i--);
+ } while (--i);
/* Clear out any pending INTAs since we aren't supposed to have
* interrupts enabled at this point... */
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] postfix decrement error in ipw2100_start_adapter(); drivers/net/wireless/ipw2100.c
2007-11-05 0:43 [PATCH] postfix decrement error in ipw2100_start_adapter(); drivers/net/wireless/ipw2100.c Roel Kluin
@ 2007-11-05 2:50 ` Zhu Yi
2007-11-05 22:55 ` Roel Kluin
1 sibling, 0 replies; 3+ messages in thread
From: Zhu Yi @ 2007-11-05 2:50 UTC (permalink / raw)
To: Roel Kluin; +Cc: linux-wireless
On Mon, 2007-11-05 at 01:43 +0100, Roel Kluin wrote:
> If i reaches zero, the loop ends, but the postfix decrement subtracts
> it to -1.
> Testing for 'i == 0', later in the function, will not fulfill its
> purpose.
>
> Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Acked-by: Zhu Yi <yi.zhu@intel.com>
Thanks,
-yi
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] postfix decrement error in ipw2100_start_adapter(); drivers/net/wireless/ipw2100.c
2007-11-05 0:43 [PATCH] postfix decrement error in ipw2100_start_adapter(); drivers/net/wireless/ipw2100.c Roel Kluin
2007-11-05 2:50 ` Zhu Yi
@ 2007-11-05 22:55 ` Roel Kluin
1 sibling, 0 replies; 3+ messages in thread
From: Roel Kluin @ 2007-11-05 22:55 UTC (permalink / raw)
To: linux-wireless
It appears there was another. The patch below includes both fixes.
--
If i reaches zero, the loop ends, but the postfix decrement subtracts it to -1.
Testing for 'i == 0', later in the function, will not fulfill its purpose.
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
index a6c7904..14632d8 100644
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -1267,7 +1267,7 @@ static int ipw2100_start_adapter(struct ipw2100_priv *priv)
IPW2100_INTA_FATAL_ERROR |
IPW2100_INTA_PARITY_ERROR);
}
- } while (i--);
+ } while (--i);
/* Clear out any pending INTAs since we aren't supposed to have
* interrupts enabled at this point... */
@@ -1339,7 +1339,7 @@ static int ipw2100_power_cycle_adapter(struct ipw2100_priv *priv)
if (reg & IPW_AUX_HOST_RESET_REG_MASTER_DISABLED)
break;
- } while (i--);
+ } while (--i);
priv->status &= ~STATUS_RESET_PENDING;
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-11-05 22:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-05 0:43 [PATCH] postfix decrement error in ipw2100_start_adapter(); drivers/net/wireless/ipw2100.c Roel Kluin
2007-11-05 2:50 ` Zhu Yi
2007-11-05 22:55 ` Roel Kluin
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).