cvs commit: src/sys/dev/pccard pccard.c pccardvar.h

John Baldwin jhb at FreeBSD.org
Thu Apr 10 09:42:26 PDT 2003


On 09-Apr-2003 Warner Losh wrote:
> imp         2003/04/09 15:07:02 PDT
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/dev/pccard       pccard.c pccardvar.h 
>   Log:
>   1.77 was bogus: there is no logic bug.  Back it out and compare the
>   correct fields instead.

At this point it doesn't matter since you only check one field now, but
there was definitely a logic bug in both 1.76 and 1.78.  If you want to
terminate a loop when both a and b are zero, you can do either:

        for (...; a != 0 || b != 0; ...)

or:

        for (...; !(a == 0 && b == 0); ...)

However, both 1.76 and 1.78 did:

        for (...; a != 0 && b != 0; ...)

Which will terminate the first time either a or b is zero, not when
both are zero.  The fact that my wavelan card didn't probe until
1.77 should help to prove that.

-- 

John Baldwin <jhb at FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/


More information about the cvs-src mailing list