Date: Thu, 5 Jul 2007 17:51:35 -0400 From: John Baldwin <jhb@freebsd.org> To: Rui Paulo <rpaulo@freebsd.org> Cc: Perforce Change Reviews <perforce@freebsd.org> Subject: Re: PERFORCE change 122829 for review Message-ID: <200707051751.35532.jhb@freebsd.org> In-Reply-To: <200707040343.l643hQ2i073492@repoman.freebsd.org> References: <200707040343.l643hQ2i073492@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 03 July 2007 11:43:26 pm Rui Paulo wrote: > -static struct asmc_model *asmc_match(device_t); > +static struct asmc_model * > + asmc_match(device_t dev); Old way was better. > #define ASMC_SMS_FUNCS asmc_mb_sysctl_sms_x, asmc_mb_sysctl_sms_y, \ > asmc_mb_sysctl_sms_z > @@ -253,21 +257,20 @@ > */ > sysctl_ctx_init(&sc->sc_sysctl_ctx); > sc->sc_root_tree = SYSCTL_ADD_NODE(&sc->sc_sysctl_ctx, > - SYSCTL_STATIC_CHILDREN(_hw), > - OID_AUTO, > - device_get_name(dev), > - CTLFLAG_RD, 0, > - device_get_desc(dev)); > + SYSCTL_STATIC_CHILDREN(_hw), > + OID_AUTO, > + device_get_name(dev), > + CTLFLAG_RD, 0, > + device_get_desc(dev)); It's actually 4 spaces from the start of the previous line, not the start of the function name or macro on the previous line, thus: sc->sc_root_tree = SYSCTL_ADD_NODE(&sc->sc_sysctl_ctx, SYSCTL_STATIC_CHILDREN(_hw), OID_AUTO, device_get_name(dev), CTL_FLAG_RD, 0, device_get_desc(dev)); However, why are you creating your own sysctl tree? new-bus already provides one in dev.foo.X. You can use 'device_get_sysctl_ctx()' and 'device_get_sysctl_tree()' with SYSCTL_ADD_*() to hang custom nodes off the existing tree which is preferable to doing your own thing under hw. -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200707051751.35532.jhb>