lkml.org 
[lkml]   [2003]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] 2.5.59 : drivers/net/fc/iph5526.c
From
Date
On Mon, 10 Feb 2003 14:01:13 +0100, Horst von Brand said:
> Rusty Russell <rusty@rustcorp.com.au> said:
>
> [...]
>
> > > - for (i = 0; i < clone_list[i].vendor_id != 0; i++)
>
> i < clone_list[i].vendor_id != 0 is (i < clone_list[i].vendor_id) != 0 is
> just i < clone_list[i].vendor_id, so the for is done for i = 0 and possibly
> for 1. Getting this effect (if desired) with an if is a load clearer.

However, looking at the definition of clone_list[], it's pretty obvious
that this was intended:

for (i=0; clone_list[i].vendor_id != 0; i++) {...

It's searching through a zero-terminated table of vendor_id's.

It's possible it started off life as
i < sizeof(clone_list) && clone_list[i].vendor_id != 0

or some such.
--
Valdis Kletnieks
Computer Systems Senior Engineer
Virginia Tech

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 13:33    [W:0.361 / U:0.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site