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

Valdis.Kletnieks@vt.edu
Tue, 11 Feb 2003 04:26:59 -0500


--==_Exmh_593412642P
Content-Type: text/plain; charset=us-ascii

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

--==_Exmh_593412642P Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) Comment: Exmh version 2.5 07/13/2001

iD8DBQE+SMHjcC3lWbTT17ARAjdaAKCBi35XmTxLZt4V0tVkI5x9U7slpQCfQZzG EMLcY+u6zabp68cS7iWF2yo= =zZWr -----END PGP SIGNATURE-----

--==_Exmh_593412642P-- - 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/