From owner-freebsd-current Sat Feb 15 22:13: 4 2003 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 E53A637B401; Sat, 15 Feb 2003 22:13:02 -0800 (PST) Received: from sasami.jurai.net (sasami.jurai.net [66.92.160.223]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0D6EE43FAF; Sat, 15 Feb 2003 22:13:02 -0800 (PST) (envelope-from winter@jurai.net) Received: from sasami.jurai.net (sasami.jurai.net [66.92.160.223]) by sasami.jurai.net (8.12.6/8.12.5) with ESMTP id h1G6D1vA056974; Sun, 16 Feb 2003 01:13:01 -0500 (EST) (envelope-from winter@jurai.net) Date: Sun, 16 Feb 2003 01:13:01 -0500 (EST) From: "Matthew N. Dodd" To: Nate Lawson Cc: current@FreeBSD.ORG, wpaul@FreeBSD.ORG Subject: Re: sys/pci/if* fixes In-Reply-To: Message-ID: <20030216011126.D73971@sasami.jurai.net> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, 15 Feb 2003, Nate Lawson wrote: > The 'if' is a matter of coding style. Which is preferred: multiple > returns from the same function (one which is only reachable from a goto) > or one linear path with an 'if' to see if this is an error exit? In this case a single return is harder to read. > See the previous thread on this regarding my original dc(4) changes. > It is bogus to create a lock with mtx_init and then immediately lock it > for the entire attach routine just for the intention of ensuring > exclusive access to the device. The problem is that the drivers aren't properly turning off interrrupts before setting up the interrupt handler. -- | Matthew N. Dodd | '78 Datsun 280Z | '75 Volvo 164E | FreeBSD/NetBSD | | winter@jurai.net | 2 x '84 Volvo 245DL | ix86,sparc,pmax | | http://www.jurai.net/~winter | For Great Justice! | ISO8802.5 4ever | To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message