cvs commit: src/sys/dev/pccard pccard.c pccardvar.h
Warner Losh
imp at harmony.village.org
Thu Apr 10 11:37:18 PDT 2003
In message <XFMail.20030410124202.jhb at FreeBSD.org> John Baldwin writes:
: 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.
Actually, this is the classic problem of the contrapositive:
(!(a == 0 && b == 0))) == (a != 0 || b != 0)
So there was a logic bug.
Warner
More information about the cvs-src
mailing list