From owner-cvs-src@FreeBSD.ORG Thu Apr 10 11:37:18 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 627BD37B401; Thu, 10 Apr 2003 11:37:18 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7BE5943F3F; Thu, 10 Apr 2003 11:37:17 -0700 (PDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost [127.0.0.1]) by harmony.village.org (8.12.8/8.12.3) with ESMTP id h3AIbGA7021295; Thu, 10 Apr 2003 12:37:16 -0600 (MDT) (envelope-from imp@harmony.village.org) Message-Id: <200304101837.h3AIbGA7021295@harmony.village.org> To: John Baldwin In-reply-to: Your message of "Thu, 10 Apr 2003 12:42:02 EDT." References: Date: Thu, 10 Apr 2003 12:37:16 -0600 From: Warner Losh cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/pccard pccard.c pccardvar.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2003 18:37:18 -0000 In message 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