Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Sep 2012 23:16:55 +0000 (UTC)
From:      Aleksandr Rybalko <ray@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r240119 - head/sys/kern
Message-ID:  <201209042316.q84NGtuA035023@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ray
Date: Tue Sep  4 23:16:55 2012
New Revision: 240119
URL: http://svn.freebsd.org/changeset/base/240119

Log:
  Style fixes.
  
  Suggested by:   mdf
  Approved by:	adrian (menthor)

Modified:
  head/sys/kern/subr_hints.c

Modified: head/sys/kern/subr_hints.c
==============================================================================
--- head/sys/kern/subr_hints.c	Tue Sep  4 23:13:24 2012	(r240118)
+++ head/sys/kern/subr_hints.c	Tue Sep  4 23:16:55 2012	(r240119)
@@ -31,8 +31,8 @@ __FBSDID("$FreeBSD$");
 #include <sys/lock.h>
 #include <sys/malloc.h>
 #include <sys/mutex.h>
-#include <sys/systm.h>
 #include <sys/sysctl.h>
+#include <sys/systm.h>
 #include <sys/bus.h>
 
 /*
@@ -52,9 +52,9 @@ static char *hintp;
 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 @@ sysctl_hintmode(SYSCTL_HANDLER_ARGS)
 
 	/* 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 @@ sysctl_hintmode(SYSCTL_HANDLER_ARGS)
 	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 @@ sysctl_hintmode(SYSCTL_HANDLER_ARGS)
 				continue;
 		}
 		eq = strchr(cp, '=');
-		if (!eq)
+		if (eq == NULL)
 			/* Bad hint value */
 			continue;
 		eqidx = eq - cp;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209042316.q84NGtuA035023>