From owner-freebsd-current@FreeBSD.ORG Wed Jan 5 13:28:00 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7CC5816A4CE; Wed, 5 Jan 2005 13:28:00 +0000 (GMT) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 690CE43D3F; Wed, 5 Jan 2005 13:28:00 +0000 (GMT) (envelope-from mux@freebsd.org) Received: by elvis.mu.org (Postfix, from userid 1920) id 581535C99C; Wed, 5 Jan 2005 05:28:00 -0800 (PST) Date: Wed, 5 Jan 2005 14:28:00 +0100 From: Maxime Henrion To: Giorgos Keramidas Message-ID: <20050105132800.GE63028@elvis.mu.org> References: <20050105131253.GA12430@orion.daedalusnetworks.priv> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050105131253.GA12430@orion.daedalusnetworks.priv> User-Agent: Mutt/1.4.2.1i cc: freebsd-current@freebsd.org Subject: Re: RFC: Inverse KASSERT in sys/dev/usb/ohci.c:1.150 ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2005 13:28:00 -0000 Giorgos Keramidas wrote: > The KASSERT that replaces an explicit if conditional in ohci.c:1.150 > causes a panic here when I try to use my USB flash disk: > > % -#ifdef DIAGNOSTIC > % - if (curlen == 0) > % - panic("ohci_alloc_std: curlen == 0"); > % -#endif > % + KASSERT ((curlen == 0), ("ohci_alloc_std: curlen == 0")); > > Shouldn't the KASSERT expression have inverse logic, i.e.: > > KASSERT((curlen != 0), ("ohci_alloc_std: curlen == 0")); Yes, it indeed should. Cheers, Maxime