From owner-svn-src-stable-11@freebsd.org Fri Jan 13 08:19:53 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED7ACCADAA8; Fri, 13 Jan 2017 08:19:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC47115AE; Fri, 13 Jan 2017 08:19:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0D8JqcS040672; Fri, 13 Jan 2017 08:19:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0D8Jq0q040671; Fri, 13 Jan 2017 08:19:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701130819.v0D8Jq0q040671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 13 Jan 2017 08:19:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r312020 - stable/11/usr.bin/top X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 08:19:54 -0000 Author: ngie Date: Fri Jan 13 08:19:52 2017 New Revision: 312020 URL: https://svnweb.freebsd.org/changeset/base/312020 Log: MFC r311710: Style fixes - Delete trailing whitespace - Use nitems(mib) instead of hardcoding the mib length Modified: stable/11/usr.bin/top/machine.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/top/machine.c ============================================================================== --- stable/11/usr.bin/top/machine.c Fri Jan 13 08:15:32 2017 (r312019) +++ stable/11/usr.bin/top/machine.c Fri Jan 13 08:19:52 2017 (r312020) @@ -413,7 +413,7 @@ format_header(char *uname_field) { static char Header[128]; const char *prehead; - + if (ps.jail) jidlength = TOP_JID_LEN + 1; /* +1 for extra left space. */ else @@ -559,7 +559,7 @@ get_system_info(struct system_info *si) arc_stats[5] = arc_stat >> 10; si->arc = arc_stats; } - + /* set arrays and strings */ if (pcpu_stats) { si->cpustates = pcpu_cpu_states; @@ -585,7 +585,7 @@ get_system_info(struct system_info *si) mib[0] = CTL_KERN; mib[1] = KERN_BOOTTIME; size = sizeof(boottime); - if (sysctl(mib, 2, &boottime, &size, NULL, 0) != -1 && + if (sysctl(mib, nitems(mib), &boottime, &size, NULL, 0) != -1 && boottime.tv_sec != 0) { si->boottime = boottime; } else { @@ -1072,7 +1072,7 @@ format_next_process(caddr_t handle, char } } - if (ps.jail == 0) + if (ps.jail == 0) jid_buf[0] = '\0'; else snprintf(jid_buf, sizeof(jid_buf), "%*d",