Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Apr 2022 03:42:56 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 1545c66789d3 - main - hwpmc_arm64: remove write only variables and the computations they do
Message-ID:  <202204060342.2363guAe089160@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=1545c66789d3d235dedfb85694cd9b6d0650833d

commit 1545c66789d3d235dedfb85694cd9b6d0650833d
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2022-04-06 01:59:18 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2022-04-06 03:42:05 +0000

    hwpmc_arm64: remove write only variables and the computations they do
    
    Sponsored by:           Netflix
---
 sys/dev/hwpmc/hwpmc_arm64.c    | 11 -----------
 sys/dev/hwpmc/hwpmc_arm64_md.c |  2 --
 2 files changed, 13 deletions(-)

diff --git a/sys/dev/hwpmc/hwpmc_arm64.c b/sys/dev/hwpmc/hwpmc_arm64.c
index 9cdb2bfc06cb..e2609dfcb474 100644
--- a/sys/dev/hwpmc/hwpmc_arm64.c
+++ b/sys/dev/hwpmc/hwpmc_arm64.c
@@ -165,7 +165,6 @@ arm64_allocate_pmc(int cpu, int ri, struct pmc *pm,
   const struct pmc_op_pmcallocate *a)
 {
 	uint32_t config;
-	struct arm64_cpu *pac;
 	enum pmc_event pe;
 
 	KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
@@ -173,8 +172,6 @@ arm64_allocate_pmc(int cpu, int ri, struct pmc *pm,
 	KASSERT(ri >= 0 && ri < arm64_npmcs,
 	    ("[arm64,%d] illegal row index %d", __LINE__, ri));
 
-	pac = arm64_pcpu[cpu];
-
 	if (a->pm_class != PMC_CLASS_ARMV8) {
 		return (EINVAL);
 	}
@@ -337,12 +334,6 @@ arm64_start_pmc(int cpu, int ri)
 static int
 arm64_stop_pmc(int cpu, int ri)
 {
-	struct pmc_hw *phw;
-	struct pmc *pm;
-
-	phw    = &arm64_pcpu[cpu]->pc_arm64pmcs[ri];
-	pm     = phw->phw_pmc;
-
 	/*
 	 * Disable the PMCs.
 	 */
@@ -372,7 +363,6 @@ arm64_release_pmc(int cpu, int ri, struct pmc *pmc)
 static int
 arm64_intr(struct trapframe *tf)
 {
-	struct arm64_cpu *pc;
 	int retval, ri;
 	struct pmc *pm;
 	int error;
@@ -386,7 +376,6 @@ arm64_intr(struct trapframe *tf)
 	    TRAPF_USERMODE(tf));
 
 	retval = 0;
-	pc = arm64_pcpu[cpu];
 
 	for (ri = 0; ri < arm64_npmcs; ri++) {
 		pm = arm64_pcpu[cpu]->pc_arm64pmcs[ri].phw_pmc;
diff --git a/sys/dev/hwpmc/hwpmc_arm64_md.c b/sys/dev/hwpmc/hwpmc_arm64_md.c
index e343d81d5172..4007b5840843 100644
--- a/sys/dev/hwpmc/hwpmc_arm64_md.c
+++ b/sys/dev/hwpmc/hwpmc_arm64_md.c
@@ -112,13 +112,11 @@ pmc_save_user_callchain(uintptr_t *cc, int maxsamples,
     struct trapframe *tf)
 {
 	uintptr_t pc, r, oldfp, fp;
-	struct thread *td;
 	int count;
 
 	KASSERT(TRAPF_USERMODE(tf), ("[arm64,%d] Not a user trap frame tf=%p",
 	    __LINE__, (void *) tf));
 
-	td = curthread;
 	pc = PMC_TRAPFRAME_TO_PC(tf);
 	*cc++ = pc;
 



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