From 9645bcabdf76e6e8bbe7052de3b3a821155c6132 Mon Sep 17 00:00:00 2001 From: Matt Macy Date: Mon, 4 Jun 2018 04:49:06 +0000 Subject: [PATCH] hwpmc: fix fixed counters checks --- sys/dev/hwpmc/hwpmc_core.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/dev/hwpmc/hwpmc_core.c b/sys/dev/hwpmc/hwpmc_core.c index 7f5aab42595b..b308f51ef181 100644 --- a/sys/dev/hwpmc/hwpmc_core.c +++ b/sys/dev/hwpmc/hwpmc_core.c @@ -251,14 +251,13 @@ iaf_allocate_pmc(int cpu, int ri, struct pmc *pm, if (ev == 0xC0 && ri != 0) return (EINVAL); /* CPU_CLK_UNHALTED.THREAD */ - else if (ev == 0x3C && ri != 1) + if (ev == 0x3C && ri != 1) return (EINVAL); /* CPU_CLK_UNHALTED.REF */ - else if (ev == 0x0 && umask == 0x3 && ri != 2) - return (EINVAL); - else + if (ev == 0x0 && umask == 0x3 && ri != 2) return (EINVAL); + flags = 0; if (config & IAP_OS) flags |= IAF_OS;