From owner-cvs-src@FreeBSD.ORG Thu Apr 10 12:28:19 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 EF01237B409 for ; Thu, 10 Apr 2003 12:28:18 -0700 (PDT) Received: from rootlabs.com (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 9443843F75 for ; Thu, 10 Apr 2003 12:28:17 -0700 (PDT) (envelope-from nate@rootlabs.com) Received: (qmail 32147 invoked by uid 1000); 10 Apr 2003 19:28:18 -0000 Date: Thu, 10 Apr 2003 12:28:18 -0700 (PDT) From: Nate Lawson To: Warner Losh In-Reply-To: <200304101837.h3AIbGA7021295@harmony.village.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org cc: John Baldwin 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 19:28:19 -0000 On Thu, 10 Apr 2003, Warner Losh wrote: > 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 DeMorgan is rolling over in his grave. :) -Nate