From owner-freebsd-hackers@FreeBSD.ORG Fri Mar 7 14:19:07 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E1151065679 for ; Fri, 7 Mar 2008 14:19:07 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 4A4398FC15 for ; Fri, 7 Mar 2008 14:19:07 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by elvis.mu.org (Postfix) with ESMTP id 158D61A4D87; Fri, 7 Mar 2008 06:18:37 -0800 (PST) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Fri, 7 Mar 2008 08:24:55 -0500 User-Agent: KMail/1.9.7 References: <47D114C5.2000108@freebsd.org> In-Reply-To: <47D114C5.2000108@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200803070824.55826.jhb@freebsd.org> Cc: =?utf-8?q?Jean-S=C3=A9bastien_P=C3=A9dron?= Subject: Re: sysctl: good practices and how to deprecate a node X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2008 14:19:07 -0000 On Friday 07 March 2008 05:11:17 am Jean-S=C3=A9bastien P=C3=A9dron wrote: > Hello, > > I'm currently working again on the Synaptics Touchpad support[1] in psm(4= ). > > The enable_synaptics() probe function adds a subtree to "hw.psm"; I > didn't changed its behaviour for now. This subtree is created only if: > o "hw.psm.synaptics_support" is true > o no previous probe function "took" the device. > If the function doesn't find a Synaptics touchpad, the tree is left > created. > > First, is enable_synaptics() the right place to add this subtree > (compared to a "globally" created tree, like "hw.psm")? Sure. > If enable_synaptics() is the way to go, should it be always created if > "hw.psm.synaptics_support" is true, even if no touchpad is found? Or > only when the touchpad is detected?=20 Probably only if you have an actual touchpad. > In psmsoftintr(), the code in FreeBSD doesn't check for bad sysctl > values. My patch doesn't do it either for now. But wrong values could > cause division by zero for example. Is there a way to check sysctls only > when they are modified, instead of before every use? Yes, use a SYSCTL_PROC() for those nodes. > Last question: I expanded the Synaptics subtree with my own nodes but > there are three nodes which are not used anymore. How should I handle > deprecation of these nodes? Just remove them. =2D-=20 John Baldwin