From owner-cvs-src@FreeBSD.ORG Tue Jul 22 14:40:18 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 322F437B407 for ; Tue, 22 Jul 2003 14:40:18 -0700 (PDT) Received: from phk.freebsd.dk (phk.freebsd.dk [212.242.86.175]) by mx1.FreeBSD.org (Postfix) with ESMTP id C372843F93 for ; Tue, 22 Jul 2003 14:40:16 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by phk.freebsd.dk (8.12.8/8.12.8) with ESMTP id h6MLeFV3024316; Tue, 22 Jul 2003 21:40:15 GMT (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.9/8.12.9) with ESMTP id h6MLeE5H015674; Tue, 22 Jul 2003 23:40:15 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: "M. Warner Losh" From: "Poul-Henning Kamp" In-Reply-To: Your message of "Tue, 22 Jul 2003 15:18:28 MDT." <20030722.151828.83724752.imp@bsdimp.com> Date: Tue, 22 Jul 2003 23:40:14 +0200 Message-ID: <15673.1058910014@critter.freebsd.dk> 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 21:40:18 -0000 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. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.