Re: [PATCH] 2.5.59 : drivers/net/fc/iph5526.c

From: Valdis.Kletnieks@vt.edu
Date: Tue Feb 11 2003 - 04:26:59 EST


On Tue, 11 Feb 2003 10:01:37 +0100, Horst von Brand said:

> > > > > - for (i = 0; i < clone_list[i].vendor_id != 0; i++)

> It isn't, as written. Something is very wrong in any case, as it should
> have blown up somewhere before.

Well, currently, there's only like 3 entries in the table - two clones
and a null. So for i=0 and i=1, 'i<vendor_id' happens to be true, and we
compare that to a zero. Then for i=2, i is greater than the terminating
null in the table, and we compare THAT to zero.

> In any case, the != 0 is redundant, idiomatic C is to just go:
>
> for (i=0; clone_list[i].vendor_id; i++) {...

True. Notice I said "what was intended", not "what is idiomatic". ;)

-- 
				Valdis Kletnieks
				Computer Systems Senior Engineer
				Virginia Tech


- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Feb 15 2003 - 22:00:32 EST