From owner-cvs-all@FreeBSD.ORG Tue Mar 23 09:31:40 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 37E4E16A4CE; Tue, 23 Mar 2004 09:31:40 -0800 (PST) Received: from mx.nsu.ru (mx.nsu.ru [212.192.164.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id DABE243D3F; Tue, 23 Mar 2004 09:31:39 -0800 (PST) (envelope-from danfe@regency.nsu.ru) Received: from regency.nsu.ru ([193.124.210.26]) by mx.nsu.ru with esmtp (Exim 4.30) id 1B5plX-0007rX-OO; Tue, 23 Mar 2004 23:32:39 +0600 Received: from regency.nsu.ru (localhost [127.0.0.1]) by regency.nsu.ru (8.12.10/8.12.10) with ESMTP id i2NHVaxm089482; Tue, 23 Mar 2004 23:31:36 +0600 (NOVT) (envelope-from danfe@regency.nsu.ru) Received: (from danfe@localhost) by regency.nsu.ru (8.12.10/8.12.10/Submit) id i2NHVagu089418; Tue, 23 Mar 2004 23:31:36 +0600 (NOVT) (envelope-from danfe) Date: Tue, 23 Mar 2004 23:31:36 +0600 From: Alexey Dokuchaev To: "M. Warner Losh" Message-ID: <20040323173136.GA88405@regency.nsu.ru> References: <20040322102119.P33645@root.org> <20040322191542.CD8DE16A4CF@hub.freebsd.org> <20040323130235.GB39851@regency.nsu.ru> <20040323.102416.32179617.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040323.102416.32179617.imp@bsdimp.com> User-Agent: Mutt/1.4.1i cc: wpaul@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-src@FreeBSD.org cc: cvs-all@FreeBSD.org cc: nate@root.org Subject: Re: cvs commit: src/sys/amd64/isa atpic.c src/sys/contrib/dev/oltr if_oltr.c src/sys/dev/aac aac_pci.c src/sys/dev/acpic X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2004 17:31:40 -0000 On Tue, Mar 23, 2004 at 10:24:16AM -0700, M. Warner Losh wrote: > In message: <20040323130235.GB39851@regency.nsu.ru> > Alexey Dokuchaev writes: > : On Mon, Mar 22, 2004 at 11:15:42AM -0800, Bill Paul wrote: > : > > : > This is the entire bus_alloc_resource_any() function: > : > > : > static __inline struct resource * > : > bus_alloc_resource_any(device_t dev, int type, int *rid, u_int flags) > : > { > : > return (bus_alloc_resource(dev, type, rid, 0ul, ~0ul, 1, flags)); > : > } > : > > : > Please to be explaining why this isn't a macro: > : > > : > #define bus_alloc_resource_any(dev, type, rid, flags) \ > : > bus_alloc_resource(dev, type, rid, 0ul, ~0ul, 1, flags) > : > : Pardon my sneaking in discussion, but I also wonder why isn't this a > : macro? I probably should blame myself for not looking at the actual > : diff when I received your commit message, but I was pretty sure that > : you've just added a macro like Bill suggested above. > > As has been explained, macros are less safe than inlines. The above > implementation suffers from a lack of (), for example. gcc and most > other modern compilers generate identical code in both these cases and > the inline gives a scoping that the macro does not. Thanks, I should probably read all my cvs-all@ mail before replying to the earliest ones. ./danfe