From owner-freebsd-arch@FreeBSD.ORG Fri Aug 31 17:55:04 2012 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 B63551065675; Fri, 31 Aug 2012 17:55:04 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 83DB08FC12; Fri, 31 Aug 2012 17:55:04 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CB4B9B945; Fri, 31 Aug 2012 13:55:03 -0400 (EDT) From: John Baldwin To: freebsd-arch@freebsd.org, embedded@freebsd.org Date: Fri, 31 Aug 2012 10:31:41 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <20120831154241.82902856.ray@dlink.ua> In-Reply-To: <20120831154241.82902856.ray@dlink.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201208311031.42163.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 31 Aug 2012 13:55:03 -0400 (EDT) Cc: Aleksandr Rybalko Subject: Re: [RFC] hintmode switch patch 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, 31 Aug 2012 17:55:04 -0000 On Friday, August 31, 2012 8:42:41 am Aleksandr Rybalko wrote: > Hi hackers, > > I already post that patch some time ago with proposed "dynamic attach > of hinted devices" patch. [1] > > But will try to do it again, step-by-step :) > > So that patch allow switch from static hints to dynamic hints. > That way embedded systems, which usually compiled with hints (static) > will be able to see/edit/add hints and/or kenv variables. > > If nobody have objections I will commit it soon. > Hope 2-3 days enough for that :) > > [1] > http://lists.freebsd.org/pipermail/freebsd-arch/2012-January/012295.html > [2] http://people.freebsd.org/~ray/subr_hints.c.patch > > Thanks. A few suggestions: 1) You can simplify sysctl_hintmode() if you do something like: value = hintmode; error = sysctl_handle_int(req, &value, 0, oidp); if (error || req->newptr == NULL) return (error); In place of doing SYSCTL_IN/OUT by hand. I prefer doing this in custom sysctl handlers so that the function is focused on the nonstandard functionality. 2) I would just leave the global comment ('Access functions..') where it is as it seems to me to be a comment for the whole file. Other than that I think this is fine. -- John Baldwin