From owner-freebsd-arch@FreeBSD.ORG Fri Jan 4 17:13:02 2008 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16DBB16A418; Fri, 4 Jan 2008 17:13:02 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id C958F13C455; Fri, 4 Jan 2008 17:13:01 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id 2CCDD17105; Fri, 4 Jan 2008 17:13:00 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.2/8.14.2) with ESMTP id m04HCxKb006796; Fri, 4 Jan 2008 17:12:59 GMT (envelope-from phk@critter.freebsd.dk) To: John Baldwin From: "Poul-Henning Kamp" In-Reply-To: Your message of "Fri, 04 Jan 2008 11:50:49 EST." <200801041150.49541.jhb@freebsd.org> Date: Fri, 04 Jan 2008 17:12:59 +0000 Message-ID: <6795.1199466779@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: Julian Elischer , freebsd-arch@freebsd.org Subject: Re: RFC: sysctl additional functions/macros X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2008 17:13:02 -0000 In message <200801041150.49541.jhb@freebsd.org>, John Baldwin writes: >On Friday 04 January 2008 11:18:29 am Poul-Henning Kamp wrote: >> In message <477E592B.9040106@elischer.org>, Julian Elischer writes: >> >John Baldwin wrote: >> >> >right, so you've solved that one.. >> >> Please no! >> >> This is far more complicated and wasteful than it needs to be. >> >> Please just include the code in the macro call and instantiate >> a function with that code inlined. > >Your code body in the example though is the just the validation step, it >doesn't have all the copyin/copyout goop (nor should it). Of course not, the SYSCTL_INT_CODE() macro should instantiate that in the new function. >Are you really >worried about the overhead of having a worker function call a function >containing the validation code? No, I'm appalled at another clutch of weird data structures to encapsulate what is really a piece of code as a number of weird fields. -- 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.