From owner-svn-src-stable-10@freebsd.org Tue Aug 15 14:21:45 2017 Return-Path: Delivered-To: svn-src-stable-10@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 8DCAFDD70CC; Tue, 15 Aug 2017 14:21:45 +0000 (UTC) (envelope-from kib@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 5CD6F71995; Tue, 15 Aug 2017 14:21:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7FELiNo084284; Tue, 15 Aug 2017 14:21:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7FELiLr084283; Tue, 15 Aug 2017 14:21:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708151421.v7FELiLr084283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 15 Aug 2017 14:21:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322543 - stable/10/sys/dev/hwpmc X-SVN-Group: stable-10 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/10/sys/dev/hwpmc X-SVN-Commit-Revision: 322543 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Aug 2017 14:21:45 -0000 Author: kib Date: Tue Aug 15 14:21:44 2017 New Revision: 322543 URL: https://svnweb.freebsd.org/changeset/base/322543 Log: MFC r322256: Fix logic error in the the assert, causing the condition to be always true. PR: 217741 Approved by: re (gjb) Modified: stable/10/sys/dev/hwpmc/hwpmc_piv.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hwpmc/hwpmc_piv.c ============================================================================== --- stable/10/sys/dev/hwpmc/hwpmc_piv.c Tue Aug 15 14:03:26 2017 (r322542) +++ stable/10/sys/dev/hwpmc/hwpmc_piv.c Tue Aug 15 14:21:44 2017 (r322543) @@ -812,8 +812,8 @@ p4_config_pmc(int cpu, int ri, struct pmc *pm) mtx_lock_spin(&pc->pc_mtx); cfgflags = P4_PCPU_GET_CFGFLAGS(pc,ri); - KASSERT(cfgflags >= 0 || cfgflags <= 3, - ("[p4,%d] illegal cfgflags cfg=%d on cpu=%d ri=%d", __LINE__, + KASSERT((cfgflags & ~0x3) == 0, + ("[p4,%d] illegal cfgflags cfg=%#x on cpu=%d ri=%d", __LINE__, cfgflags, cpu, ri)); KASSERT(cfgflags == 0 || phw->phw_pmc, @@ -838,8 +838,8 @@ p4_config_pmc(int cpu, int ri, struct pmc *pm) phw->phw_pmc = NULL; } - KASSERT(cfgflags >= 0 || cfgflags <= 3, - ("[p4,%d] illegal runcount cfg=%d on cpu=%d ri=%d", __LINE__, + KASSERT((cfgflags & ~0x3) == 0, + ("[p4,%d] illegal runcount cfg=%#x on cpu=%d ri=%d", __LINE__, cfgflags, cpu, ri)); P4_PCPU_SET_CFGFLAGS(pc,ri,cfgflags);