Date: Fri, 7 Mar 2008 08:24:55 -0500 From: John Baldwin <jhb@freebsd.org> To: freebsd-hackers@freebsd.org Cc: =?utf-8?q?Jean-S=C3=A9bastien_P=C3=A9dron?= <dumbbell@freebsd.org> Subject: Re: sysctl: good practices and how to deprecate a node Message-ID: <200803070824.55826.jhb@freebsd.org> In-Reply-To: <47D114C5.2000108@freebsd.org> References: <47D114C5.2000108@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200803070824.55826.jhb>