From owner-freebsd-scsi@FreeBSD.ORG Tue Dec 5 05:27:27 2006 Return-Path: X-Original-To: freebsd-scsi@FreeBSD.org Delivered-To: freebsd-scsi@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0064D16A416; Tue, 5 Dec 2006 05:27:26 +0000 (UTC) (envelope-from bde@zeta.org.au) Received: from mailout1.pacific.net.au (mailout1-3.pacific.net.au [61.8.2.210]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6F89B43C9D; Tue, 5 Dec 2006 05:26:49 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.2.163]) by mailout1.pacific.net.au (Postfix) with ESMTP id C24345A3C12; Tue, 5 Dec 2006 16:27:19 +1100 (EST) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailproxy2.pacific.net.au (Postfix) with ESMTP id 77D1327407; Tue, 5 Dec 2006 16:27:18 +1100 (EST) Date: Tue, 5 Dec 2006 16:27:17 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Ade Lovett In-Reply-To: <02408F0C-838D-496A-8BE3-6049C9E77C76@freebsd.org> Message-ID: <20061205161849.S28896@delplex.bde.org> References: <20061119161631.L44297@ns1.feral.com> <3bbf2fe10611191631h6883b862uf8088533913a7bc6@mail.gmail.com> <20061120221153.GA5155@lor.one-eyed-alien.net> <3bbf2fe10611201418m15d50703m37d9d5620e5c832d@mail.gmail.com> <20061204150922.F18492@ns1.feral.com> <20061205140644.Q28464@delplex.bde.org> <20061204192720.P19791@ns1.feral.com> <20061204202639.B20246@ns1.feral.com> <02408F0C-838D-496A-8BE3-6049C9E77C76@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-scsi@FreeBSD.org, mjacob@FreeBSD.org Subject: Re: a code reduction function addition to cam_xpt X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Dec 2006 05:27:27 -0000 On Mon, 4 Dec 2006, Ade Lovett wrote: > On Dec 04, 2006, at 20:27 , mjacob@freebsd.org wrote: >>> On Dec 04, 2006, at 19:27 , mjacob@freebsd.org wrote: >>>> IOCCC? >>> >>> http://www.ioccc.org/ Or just google it. >>> Consider this another vote for "function" ;) >> >> Bruce is usually less indirect. What gives? You haven't talked to me enough :-). > Multi-line #define's are 'orrible (IMO) -- of course, our tree is littered > with them, but it's highly preferable to have a function over a define, > particularly when it comes to reading the code n months later, trying to > track something down. In this particular case, the minimal overhead of > calling a function rather than having it inline (via #define) is vastly > outweighed by code-readability, and reduction in kernel size. And in many cases reducing the kernel size also reduces time due to it reducing cache misses. Here I think the code is so rarely executed that neither space or time efficiency really matters. Bruce