From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 23:16:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F0896106566C; Tue, 4 Sep 2012 23:16:55 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC0988FC0A; Tue, 4 Sep 2012 23:16:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q84NGt8T035025; Tue, 4 Sep 2012 23:16:55 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q84NGtuA035023; Tue, 4 Sep 2012 23:16:55 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201209042316.q84NGtuA035023@svn.freebsd.org> From: Aleksandr Rybalko Date: Tue, 4 Sep 2012 23:16:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240119 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 23:16:56 -0000 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 #include #include -#include #include +#include #include /* @@ -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;