[Zrouter-src-freebsd] ZRouter.org: push to FreeBSD HEAD tree

zrouter-src-freebsd at zrouter.org zrouter-src-freebsd at zrouter.org
Tue Sep 4 23:19:23 UTC 2012


details:   http://zrouter.org/hg/FreeBSD/head//rev/acc2717aee61
changeset: 534:acc2717aee61
user:      Aleksandr Rybalko <ray at ddteam.net>
date:      Wed Sep 05 02:21:23 2012 +0300
description:
Apply hintmode style update

diffstat:

 head/sys/kern/subr_hints.c |  17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diffs (63 lines):

diff -r 8b2a3ce4baaa -r acc2717aee61 head/sys/kern/subr_hints.c
--- a/head/sys/kern/subr_hints.c	Mon Sep 03 16:21:05 2012 +0300
+++ b/head/sys/kern/subr_hints.c	Wed Sep 05 02:21:23 2012 +0300
@@ -25,14 +25,14 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/kern/subr_hints.c 229272 2012-01-02 12:12:10Z ed $");
+__FBSDID("$FreeBSD: head/sys/kern/subr_hints.c 240119 2012-09-04 23:16:55Z ray $");
 
 #include <sys/param.h>
 #include <sys/lock.h>
 #include <sys/malloc.h>
 #include <sys/mutex.h>
+#include <sys/sysctl.h>
 #include <sys/systm.h>
-#include <sys/sysctl.h>
 #include <sys/bus.h>
 
 /*
@@ -52,9 +52,9 @@
 static int
 sysctl_hintmode(SYSCTL_HANDLER_ARGS)
 {
-	int error, i, from_kenv, value, eqidx;
 	const char *cp;
 	char *line, *eq;
+	int eqidx, error, from_kenv, i, value;
 
 	from_kenv = 0;
 	cp = kern_envp;
@@ -62,7 +62,7 @@
 
 	/* Fetch candidate for new hintmode value */
 	error = sysctl_handle_int(oidp, &value, 0, req);
-	if (error || !req->newptr)
+	if (error || req->newptr == NULL)
 		return (error);
 
 	if (value != 2)
@@ -73,8 +73,11 @@
 	switch (hintmode) {
 	case 0:
 		if (dynamic_kenv) {
-			/* Already here */
-			hintmode = value; /* XXX: Need we switch or not ? */
+			/*
+			 * Already here. But assign hintmode to 2, to not
+			 * check it in the future.
+			 */
+			hintmode = 2;
 			return (0);
 		}
 		from_kenv = 1;
@@ -98,7 +101,7 @@
 				continue;
 		}
 		eq = strchr(cp, '=');
-		if (!eq)
+		if (eq == NULL)
 			/* Bad hint value */
 			continue;
 		eqidx = eq - cp;


More information about the Zrouter-src-freebsd mailing list