* [PATCH] wavelan: Test arraysize before an element of the array.
@ 2009-02-11 20:51 Roel Kluin
2009-02-11 21:15 ` Jean Tourrilhes
0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-02-11 20:51 UTC (permalink / raw)
To: jt; +Cc: linux-wireless, Andrew Morton
Test arraysize before an element of the array.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/net/wireless/wavelan.c b/drivers/net/wireless/wavelan.c
index 8326793..5439e39 100644
--- a/drivers/net/wireless/wavelan.c
+++ b/drivers/net/wireless/wavelan.c
@@ -4281,8 +4281,7 @@ int __init init_module(void)
/* Loop on all possible base addresses. */
- i = -1;
- while ((io[++i] != 0) && (i < ARRAY_SIZE(io))) {
+ for (i = 0; i < ARRAY_SIZE(io) && io[i] != 0; i++) {
struct net_device *dev = alloc_etherdev(sizeof(net_local));
if (!dev)
break;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] wavelan: Test arraysize before an element of the array.
2009-02-11 20:51 [PATCH] wavelan: Test arraysize before an element of the array Roel Kluin
@ 2009-02-11 21:15 ` Jean Tourrilhes
0 siblings, 0 replies; 2+ messages in thread
From: Jean Tourrilhes @ 2009-02-11 21:15 UTC (permalink / raw)
To: Roel Kluin; +Cc: linux-wireless, Andrew Morton
On Wed, Feb 11, 2009 at 09:51:31PM +0100, Roel Kluin wrote:
> Test arraysize before an element of the array.
>=20
Hmm... I don=B4t see the point. The array can not be empty, as
it=B4s a constant, and would make the driver totally useless. But feel
free to send it to push it through John Linville if you feel strongly
about it...
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Regards,
Jean
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-02-11 21:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-11 20:51 [PATCH] wavelan: Test arraysize before an element of the array Roel Kluin
2009-02-11 21:15 ` Jean Tourrilhes
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.