Skip to contentSkip to conversation

wavelan: Test arraysize before an element of the array.

PATCH In review Roel Kluin 2 participants 2 messages Feb 11, 2009 Networking drivers (wireless)

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 wavelan: Test arraysize before an element of the array.

Test arraysize before an element of the array.

---

drivers/net/wireless/wavelan.c +1 -2
index 8326793..5439e39 100644
@@ -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;
#1 lore raw
Quoted 2 lines · Roel Kluin

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...

Quoted 1 line

Regards,

Jean
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html