From nobody Sun Jan 22 09:19:24 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P073J59LXz315W3; Sun, 22 Jan 2023 09:19:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P073J4bdbz3Q6x; Sun, 22 Jan 2023 09:19:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674379164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q3r+8y2CcWLUCZoT9DoYX5UI2O2z3Dm37xZE8m2cLTY=; b=kPoWgxCEmkWY0s6MNdteNBD+WLh3LkH26+k2Qx6nhMnnb6lA0KJI89IkCXniYAVbrCeMtx bEYXkQ+WIs8ZUHP2XlyQMLjpDCtdZBicU+hYVmRXTNBwH11bcDY5D3cwf2Q5lBp2FNMwRT qFTLF64GvJ3YnSim3UqKKp7SsxeKeWLk3/B+v5ddpxGy6OTsW8BhyBYwXk5pSOAjg4k3fn 9MAC1zHGui3Pl4Yh0w+uAalGKUnNt883oZsN0HBj+tfsf31SOVdiNQ9EF1XVR5dJmeCm9B WMez3H7Md9Kx0MioMxgxMe3KgC89UK+jrVMPtYnYnwicnX4yT8GWoEk5ajuGdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674379164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q3r+8y2CcWLUCZoT9DoYX5UI2O2z3Dm37xZE8m2cLTY=; b=hmBRlf8hKok7qMpQfXs44jovqLYDv/cFX100R+F+GK7HAIYRPkeplPcsVtBbGIx7i7YIbw R5k0necu+WKe5S05zCEz7tVhnnKetonGKu6Bgfru2JXNP5ztxWhvIYs1ZtTCwo7q2jRqM9 g2Pab9+hyGdLtyPRJGdy4/ZIIzVMSXucDXV5hnCgrCpUa1SnMFQ7SG5QtIP53vYQbXyAE6 qdsl+hr+Wtvg4LMX5IqePWXnCi9UZr+mLcAld1p4/rw+ltm5UsREhCIgTjSNr1MA1VRsTq wUE2PmJTtNj7nXLm3SId1X9IW7NohdFCK32ZP9Uerfp0uzgQFTe31k5xH4IyoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674379164; a=rsa-sha256; cv=none; b=QS2VD5LOTY5pUoyO9J6yNc62tzXgfjKa8fKTKhxNmrgmOOSZuvBoFcF1DPP6KQgwDZfFC8 9GaM3DW2R4+NNsUzCBDC6e8uw4aQQxrwXWN7aCkPd0xKJ084VRr0mds9hSDlnKcE3/395l oGJoN9uB0U/xcDDAo7p8Jz1GdcgPaMn6eG9XSagpSiwZI4c6JyiRIsRz3GOTosLCrOU/d2 ckRASCcvtoaXiCr/Sodbdd2ZPPIoLST2hAcFRYWI09gJZG7ZBFqBStEFksr1BZF1jmdhwM CJIPBl9QGNm3CAASb9HmGaSFKaLcFkzpfvD/b1QjWZuczPoKO8ffrOlXN5GdbQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P073J3KWNzk8y; Sun, 22 Jan 2023 09:19:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30M9JOnq044378; Sun, 22 Jan 2023 09:19:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30M9JOBJ044377; Sun, 22 Jan 2023 09:19:24 GMT (envelope-from git) Date: Sun, 22 Jan 2023 09:19:24 GMT Message-Id: <202301220919.30M9JOBJ044377@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 2d35b26a22d6 - stable/13 - vmstat: remove shadow variables List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2d35b26a22d68af354161ceec845fc4378ccd7f1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2d35b26a22d68af354161ceec845fc4378ccd7f1 commit 2d35b26a22d68af354161ceec845fc4378ccd7f1 Author: Elliott Mitchell AuthorDate: 2022-09-21 02:18:23 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-22 09:18:10 +0000 vmstat: remove shadow variables (cherry picked from commit d4d79718496753493f059cb8f2b2e87e0b7019b0) --- usr.bin/vmstat/vmstat.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c index 5e04dc26ac6c..9414855b2a68 100644 --- a/usr.bin/vmstat/vmstat.c +++ b/usr.bin/vmstat/vmstat.c @@ -1284,29 +1284,26 @@ static void print_intrcnts(unsigned long *intrcnts, unsigned long *old_intrcnts, char *intrnames, unsigned int nintr, size_t istrnamlen, long long period_ms) { - unsigned long *intrcnt, *old_intrcnt; - char *intrname; uint64_t inttotal, old_inttotal, total_count, total_rate; unsigned long count, rate; unsigned int i; inttotal = 0; old_inttotal = 0; - intrname = intrnames; xo_open_list("interrupt"); - for (i = 0, intrcnt=intrcnts, old_intrcnt=old_intrcnts; i < nintr; i++) { - if (intrname[0] != '\0' && (*intrcnt != 0 || aflag)) { - count = *intrcnt - *old_intrcnt; + for (i = 0; i < nintr; i++) { + if (intrnames[0] != '\0' && (*intrcnts != 0 || aflag)) { + count = *intrcnts - *old_intrcnts; rate = ((uint64_t)count * 1000 + period_ms / 2) / period_ms; xo_open_instance("interrupt"); xo_emit("{d:name/%-*s}{ket:name/%s} " "{:total/%20lu} {:rate/%10lu}\n", - (int)istrnamlen, intrname, intrname, count, rate); + (int)istrnamlen, intrnames, intrnames, count, rate); xo_close_instance("interrupt"); } - intrname += strlen(intrname) + 1; - inttotal += *intrcnt++; - old_inttotal += *old_intrcnt++; + intrnames += strlen(intrnames) + 1; + inttotal += *intrcnts++; + old_inttotal += *old_intrcnts++; } total_count = inttotal - old_inttotal; total_rate = (total_count * 1000 + period_ms / 2) / period_ms;