From owner-dev-commits-src-main@freebsd.org Wed Jul 28 17:10:54 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 A2B39660CE7; Wed, 28 Jul 2021 17:10:54 +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 4GZgCy3rs8z3jQn; Wed, 28 Jul 2021 17:10:54 +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 6CE3221AEE; Wed, 28 Jul 2021 17:10:54 +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 16SHAs7w031617; Wed, 28 Jul 2021 17:10:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16SHAsLc031616; Wed, 28 Jul 2021 17:10:54 GMT (envelope-from git) Date: Wed, 28 Jul 2021 17:10:54 GMT Message-Id: <202107281710.16SHAsLc031616@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Leandro Lupori Subject: git: 7844e5a4fc0a - main - powerpc: change mfpvr return type to uint32_t MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: luporl X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7844e5a4fc0a925a53a7e1969d12a84d1baa970f 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: Wed, 28 Jul 2021 17:10:54 -0000 The branch main has been updated by luporl: URL: https://cgit.FreeBSD.org/src/commit/?id=7844e5a4fc0a925a53a7e1969d12a84d1baa970f commit 7844e5a4fc0a925a53a7e1969d12a84d1baa970f Author: Leandro Lupori AuthorDate: 2021-07-28 17:03:53 +0000 Commit: Leandro Lupori CommitDate: 2021-07-28 17:08:19 +0000 powerpc: change mfpvr return type to uint32_t As the Processor Version Register (PVR) is a 32-bit PowerPC register, change mfpvr() return type to match it and avoid type casts on its callers. Suggested by: jhibbits Reviewed by: jhibbits, imp Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D31332 --- sys/dev/hwpmc/hwpmc_powerpc.c | 2 +- sys/powerpc/include/cpufunc.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/hwpmc/hwpmc_powerpc.c b/sys/dev/hwpmc/hwpmc_powerpc.c index 407af94a07e1..0f14f93e6415 100644 --- a/sys/dev/hwpmc/hwpmc_powerpc.c +++ b/sys/dev/hwpmc/hwpmc_powerpc.c @@ -604,7 +604,7 @@ pmc_md_initialize() } /* Set the value for kern.hwpmc.cpuid */ - snprintf(pmc_cpuid, sizeof(pmc_cpuid), "%08jx", (uintmax_t)mfpvr()); + snprintf(pmc_cpuid, sizeof(pmc_cpuid), "%08x", mfpvr()); return (pmc_mdep); } diff --git a/sys/powerpc/include/cpufunc.h b/sys/powerpc/include/cpufunc.h index 7b0039166436..5ae2345bd717 100644 --- a/sys/powerpc/include/cpufunc.h +++ b/sys/powerpc/include/cpufunc.h @@ -125,10 +125,10 @@ mfdec(void) return (value); } -static __inline register_t +static __inline uint32_t mfpvr(void) { - register_t value; + uint32_t value; __asm __volatile ("mfpvr %0" : "=r"(value));