From owner-cvs-src@FreeBSD.ORG Tue Jul 22 15:40:02 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 26E1437B405; Tue, 22 Jul 2003 15:40:02 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0D61C43F3F; Tue, 22 Jul 2003 15:40:00 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.9/8.12.3) with ESMTP id h6MMdvFL052383; Tue, 22 Jul 2003 16:39:57 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Tue, 22 Jul 2003 16:39:46 -0600 (MDT) Message-Id: <20030722.163946.94245610.imp@bsdimp.com> To: phk@phk.freebsd.dk From: "M. Warner Losh" In-Reply-To: <15673.1058910014@critter.freebsd.dk> References: <20030722.151828.83724752.imp@bsdimp.com> <15673.1058910014@critter.freebsd.dk> X-Mailer: Mew version 2.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: src-committers@FreeBSD.org cc: bde@zeta.org.au cc: paul@freebsd-services.com cc: cvs-src@FreeBSD.org cc: das@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/lnc if_lnc.c 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: Tue, 22 Jul 2003 22:40:02 -0000 In message: <15673.1058910014@critter.freebsd.dk> "Poul-Henning Kamp" writes: : In message <20030722.151828.83724752.imp@bsdimp.com>, "M. Warner Losh" writes: : : >There's one other place that we use inlining. We use it to make sure : >that modules do not contain references to certain symbols. For : >example: : > : >/* : > * make this inline so that we don't have to worry about dangling references : > * to it in the modules or the code. : > */ : >static __inline const struct pccard_product * : >pccard_product_lookup(device_t dev, const struct pccard_product *tab, : > size_t ent_size, pccard_product_match_fn matchfn) : >{ : > return CARD_DO_PRODUCT_LOOKUP(device_get_parent(dev), dev, : > tab, ent_size, matchfn); : >} : > : >We do this to get the type safty of the function call and not have to : >make that a macro. We do *NOT* want references to : >pccard_product_lookup, but the CARD_DO_.. kobj call allows the : >indirection that makes it possible to use the same module in kernels : >with and without pccard support. : : I would argue that this should be solved by giving non-pccard kernels : a stub function which returns whatever error is logical (NULL in this : case ?) rather than abusing either of macros or inlines. There's no convenient way to do that, to be honest. Easy to say, hard to do. And you need it for pci, eisa, isa and other things. And it doesn't let you then load pccard after boot. I don't think it is a viable solution. Warner