From owner-dev-commits-src-main@freebsd.org Thu Jul 15 15:16:05 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F83D648E99; Thu, 15 Jul 2021 15:16:05 +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 4GQdHS4GCMz4Rwy; Thu, 15 Jul 2021 15:16:04 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 721E03CCF; Thu, 15 Jul 2021 15:16:04 +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 16FFG4oK054136; Thu, 15 Jul 2021 15:16:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16FFG4NK054135; Thu, 15 Jul 2021 15:16:04 GMT (envelope-from git) Date: Thu, 15 Jul 2021 15:16:04 GMT Message-Id: <202107151516.16FFG4NK054135@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: aee6e7dc0cab - main - hwpmc: mostly clean up cc --analyze MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aee6e7dc0cabc670f3a9eabac579a030b363a417 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jul 2021 15:16:05 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=aee6e7dc0cabc670f3a9eabac579a030b363a417 commit aee6e7dc0cabc670f3a9eabac579a030b363a417 Author: Mateusz Guzik AuthorDate: 2021-07-15 14:01:11 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-15 15:15:55 +0000 hwpmc: mostly clean up cc --analyze Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/dev/hwpmc/hwpmc_amd.c | 2 +- sys/dev/hwpmc/hwpmc_core.c | 5 +---- sys/dev/hwpmc/hwpmc_logging.c | 4 +--- sys/dev/hwpmc/hwpmc_mod.c | 7 +++---- sys/dev/hwpmc/hwpmc_soft.c | 8 +++----- sys/dev/hwpmc/hwpmc_tsc.c | 4 ++-- sys/dev/hwpmc/hwpmc_uncore.c | 4 +--- 7 files changed, 12 insertions(+), 22 deletions(-) diff --git a/sys/dev/hwpmc/hwpmc_amd.c b/sys/dev/hwpmc/hwpmc_amd.c index d54cf52f1082..a95615926bc3 100644 --- a/sys/dev/hwpmc/hwpmc_amd.c +++ b/sys/dev/hwpmc/hwpmc_amd.c @@ -669,7 +669,7 @@ amd_release_pmc(int cpu, int ri, struct pmc *pmc) #ifdef HWPMC_DEBUG const struct amd_descr *pd; #endif - struct pmc_hw *phw; + struct pmc_hw *phw __diagused; (void) pmc; diff --git a/sys/dev/hwpmc/hwpmc_core.c b/sys/dev/hwpmc/hwpmc_core.c index f49aeb2fcfd9..b0773227fac7 100644 --- a/sys/dev/hwpmc/hwpmc_core.c +++ b/sys/dev/hwpmc/hwpmc_core.c @@ -741,7 +741,6 @@ static int iap_allocate_pmc(int cpu, int ri, struct pmc *pm, const struct pmc_op_pmcallocate *a) { - enum pmc_event map; uint8_t ev; uint32_t caps; const struct pmc_md_iap_op_pmcallocate *iap; @@ -755,7 +754,6 @@ iap_allocate_pmc(int cpu, int ri, struct pmc *pm, caps = a->pm_caps; if ((IAP_PMC_CAPS & caps) != caps) return (EPERM); - map = 0; /* XXX: silent GCC warning */ iap = &a->pm_md.pm_iap; ev = IAP_EVSEL_GET(iap->pm_iap_config); @@ -961,7 +959,7 @@ iap_start_pmc(int cpu, int ri) static int iap_stop_pmc(int cpu, int ri) { - struct pmc *pm; + struct pmc *pm __diagused; struct core_cpu *cc; uint64_t msr; @@ -985,7 +983,6 @@ iap_stop_pmc(int cpu, int ri) if (core_cputype == PMC_CPU_INTEL_CORE) return (0); - msr = 0; do { cc->pc_resync = 0; cc->pc_globalctrl &= ~(1ULL << ri); diff --git a/sys/dev/hwpmc/hwpmc_logging.c b/sys/dev/hwpmc/hwpmc_logging.c index e76aa9b710eb..c13b87f4165f 100644 --- a/sys/dev/hwpmc/hwpmc_logging.c +++ b/sys/dev/hwpmc/hwpmc_logging.c @@ -550,7 +550,7 @@ pmclog_release(struct pmc_owner *po) static uint32_t * pmclog_reserve(struct pmc_owner *po, int length) { - uintptr_t newptr, oldptr; + uintptr_t newptr, oldptr __diagused; struct pmclog_buffer *plb, **pplb; PMCDBG2(LOG,ALL,1, "po=%p len=%d", po, length); @@ -693,7 +693,6 @@ pmclog_configure_log(struct pmc_mdep *md, struct pmc_owner *po, int logfd) { struct proc *p; struct timespec ts; - uint64_t tsc; int error; sx_assert(&pmc_sx, SA_XLOCKED); @@ -722,7 +721,6 @@ pmclog_configure_log(struct pmc_mdep *md, struct pmc_owner *po, int logfd) p->p_flag |= P_HWPMC; PROC_UNLOCK(p); nanotime(&ts); - tsc = pmc_rdtsc(); /* create a log initialization entry */ PMCLOG_RESERVE_WITH_ERROR(po, INITIALIZE, sizeof(struct pmclog_initialize)); diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c index 6f7753dd11c1..8d5d0183d3ad 100644 --- a/sys/dev/hwpmc/hwpmc_mod.c +++ b/sys/dev/hwpmc/hwpmc_mod.c @@ -1351,7 +1351,7 @@ pmc_process_csw_in(struct thread *td) struct pmc *pm; struct proc *p; struct pmc_cpu *pc; - struct pmc_hw *phw; + struct pmc_hw *phw __diagused; pmc_value_t newvalue; struct pmc_process *pp; struct pmc_thread *pt; @@ -2769,7 +2769,7 @@ static void pmc_release_pmc_descriptor(struct pmc *pm) { enum pmc_mode mode; - struct pmc_hw *phw; + struct pmc_hw *phw __diagused; u_int adjri, ri, cpu; struct pmc_owner *po; struct pmc_binding pb; @@ -4336,7 +4336,6 @@ pmc_syscall_handler(struct thread *td, void *syscall_args) if ((error = copyin(arg, &prw, sizeof(prw))) != 0) break; - ri = 0; PMCDBG2(PMC,OPS,1, "rw id=%d flags=0x%x", prw.pm_pmcid, prw.pm_flags); @@ -4920,7 +4919,7 @@ pmc_process_samples(int cpu, ring_type_t ring) struct pmc_sample *ps; struct pmc_classdep *pcd; struct pmc_samplebuffer *psb; - uint64_t delta; + uint64_t delta __diagused; KASSERT(PCPU_GET(cpuid) == cpu, ("[pmc,%d] not on the correct CPU pcpu=%d cpu=%d", __LINE__, diff --git a/sys/dev/hwpmc/hwpmc_soft.c b/sys/dev/hwpmc/hwpmc_soft.c index 77a8c7b3abbb..cf2401e9159e 100644 --- a/sys/dev/hwpmc/hwpmc_soft.c +++ b/sys/dev/hwpmc/hwpmc_soft.c @@ -264,7 +264,7 @@ soft_pcpu_init(struct pmc_mdep *md, int cpu) static int soft_read_pmc(int cpu, int ri, pmc_value_t *v) { - struct pmc *pm; + struct pmc *pm __diagused; const struct pmc_hw *phw; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), @@ -288,8 +288,7 @@ soft_read_pmc(int cpu, int ri, pmc_value_t *v) static int soft_write_pmc(int cpu, int ri, pmc_value_t v) { - struct pmc *pm; - const struct soft_descr *pd; + struct pmc *pm __diagused; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[soft,%d] illegal cpu value %d", __LINE__, cpu)); @@ -297,7 +296,6 @@ soft_write_pmc(int cpu, int ri, pmc_value_t v) ("[soft,%d] illegal row-index %d", __LINE__, ri)); pm = soft_pcpu[cpu]->soft_hw[ri].phw_pmc; - pd = &soft_pmcdesc[ri]; KASSERT(pm, ("[soft,%d] cpu %d ri %d pmc not configured", __LINE__, cpu, ri)); @@ -312,7 +310,7 @@ soft_write_pmc(int cpu, int ri, pmc_value_t v) static int soft_release_pmc(int cpu, int ri, struct pmc *pmc) { - struct pmc_hw *phw; + struct pmc_hw *phw __diagused; enum pmc_event ev; struct pmc_soft *ps; diff --git a/sys/dev/hwpmc/hwpmc_tsc.c b/sys/dev/hwpmc/hwpmc_tsc.c index ef11e6991aed..6cd098a8113b 100644 --- a/sys/dev/hwpmc/hwpmc_tsc.c +++ b/sys/dev/hwpmc/hwpmc_tsc.c @@ -237,7 +237,7 @@ static int tsc_read_pmc(int cpu, int ri, pmc_value_t *v) { struct pmc *pm; - enum pmc_mode mode; + enum pmc_mode mode __diagused; const struct pmc_hw *phw; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), @@ -265,7 +265,7 @@ tsc_read_pmc(int cpu, int ri, pmc_value_t *v) static int tsc_release_pmc(int cpu, int ri, struct pmc *pmc) { - struct pmc_hw *phw; + struct pmc_hw *phw __diagused; (void) pmc; diff --git a/sys/dev/hwpmc/hwpmc_uncore.c b/sys/dev/hwpmc/hwpmc_uncore.c index 594367c3542a..2c638833dcd9 100644 --- a/sys/dev/hwpmc/hwpmc_uncore.c +++ b/sys/dev/hwpmc/hwpmc_uncore.c @@ -189,7 +189,6 @@ static int ucf_allocate_pmc(int cpu, int ri, struct pmc *pm, const struct pmc_op_pmcallocate *a) { - enum pmc_event ev; uint32_t caps, flags; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), @@ -206,7 +205,6 @@ ucf_allocate_pmc(int cpu, int ri, struct pmc *pm, (caps & UCF_PMC_CAPS) != caps) return (EINVAL); - ev = pm->pm_event; flags = UCF_EN; pm->pm_md.pm_ucf.pm_ucf_ctrl = (flags << (ri * 4)); @@ -718,7 +716,7 @@ ucp_start_pmc(int cpu, int ri) static int ucp_stop_pmc(int cpu, int ri) { - struct pmc *pm; + struct pmc *pm __diagused; struct uncore_cpu *cc; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),