PERFORCE change 122829 for review

John Baldwin jhb at freebsd.org
Thu Jul 5 21:56:22 UTC 2007


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


More information about the p4-projects mailing list