[RFC] hintmode switch patch

John Baldwin jhb at freebsd.org
Fri Aug 31 17:55:04 UTC 2012


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


More information about the freebsd-embedded mailing list