From nobody Fri Apr 3 10:19:24 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 306D5231830; Tue, 24 Mar 2026 14:15:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774361726; cv=none; b=J5QogSVcIA+p1xQ0xJKut8LXCxLW2vGLNrUM6rCsbuyrMzta0OlDdnKWKLLOd3x6tVLLbLBbIadxBAbF7eqhV6Oo54EzkJcjntiXVtec8IwY44E99vEZGN4s5F6Qfh7tG/3N+mwSvFuDIprUDOefBnvdnaJxiVhdtMFYcJy5W08= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774361726; c=relaxed/simple; bh=TXZ+BaFMh2wq5TDPM9Amgwwz9JMEFXCR4dSKSo7Iv10=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=WJ1mZ6zhgceIknmmqTgjJ25d/utSg2IV3CqoZFJzCRib9RO+eL9WjOaZMYMXPfdInOeMjii/LA/gpkJ+lX83ntLo5stmEZqTi9FCirophvH6eRpwjJjjGFvE2VrbTcPLfyjGu6ykFhOn18gIpz/tIje3uAy0RstlqhzKfXQTTDc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=gTiLkBl/; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=3YtwgRzY; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="gTiLkBl/"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="3YtwgRzY" Date: Tue, 24 Mar 2026 14:15:21 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1774361723; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5VmupT9eUafa4rN806W7vAKSEA1R1Y6bjdVo+C+YIOM=; b=gTiLkBl/6MDDbt0XcD2pUqqwb/isi8xhHG395jBvBUtesJQMGeaInwSkGJs0PhGzD2TWdF HCgTWcoE5jI88CTfpPyJWRPddudlPwrAirOmDSKUpnRNT2sHVOChMEoSs4GQlveuAYyF6O 0Odr49CJRGbx51xYuPb80DbQe3o2R+VOjAHIH+vxQXH0xLSknjwJ6ITn/mPmEyvv6oIWIe C7xlm7c6fnbh7bHb0Ug8GUYzJ1KbokP1AWhxCKe7QDS7WeJfBpiYGqpl4gYA473e/t07Ka E7U+RYui78fyt2Azo99GeAVhjQgU/HJqlxrIWNHnxhhRjcaGamYWjDCXiKASEw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1774361723; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5VmupT9eUafa4rN806W7vAKSEA1R1Y6bjdVo+C+YIOM=; b=3YtwgRzYavNnrmaX5HDmXdOIStDoYYLhl4gp92jdH4r3qKhHv7BCl+C61k+1nBObzwKFLP saZEwolMhykAyvDQ== From: "tip-bot2 for Aldo Conte" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] perf/x86/intel/p4: Fix unused variable warning in p4_pmu_init() Cc: Dave Hansen , Aldo Conte , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260320112302.281549-1-aldocontelk@gmail.com> References: <20260320112302.281549-1-aldocontelk@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177436172165.1647592.15384252197647841900.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the perf/core branch of tip: Commit-ID: 6ee26b7a224b27aa7e8e1ee8a845a31664d2e97c Gitweb: https://git.kernel.org/tip/6ee26b7a224b27aa7e8e1ee8a845a3166= 4d2e97c Author: Aldo Conte AuthorDate: Fri, 20 Mar 2026 12:23:02 +01:00 Committer: Peter Zijlstra CommitterDate: Tue, 24 Mar 2026 15:11:42 +01:00 perf/x86/intel/p4: Fix unused variable warning in p4_pmu_init() Build the kernel with make W=3D1 generates the following warning: arch/x86/events/intel/p4.c: In function =E2=80=98p4_pmu_init=E2=80=99: arch/x86/events/intel/p4.c:1370:27: error: variable =E2=80=98high=E2=80= =99 set but not used [-Werror=3Dunused-but-set-variable] 1370 | unsigned int low, high; | ^~~~ This happens because, although both variables are declared and initialized by rdmsr, only `low` is used in the subsequent if statement. This patch uses the rdmsrq() macro instead of the rdmsr() macro. The rdmsrq() macro avoids the use of high and low variables because it reads the msr value in a single u64 variable. Also, replace (1 << 7) with the proper macro. Running `make W=3D1` again resolves the error. I was unable to test the patch because i do not have the hardware. Suggested-by: Dave Hansen Signed-off-by: Aldo Conte Signed-off-by: Peter Zijlstra (Intel) Link: https://patch.msgid.link/20260320112302.281549-1-aldocontelk@gmail.com --- arch/x86/events/intel/p4.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/events/intel/p4.c b/arch/x86/events/intel/p4.c index e5fd736..02bfdb7 100644 --- a/arch/x86/events/intel/p4.c +++ b/arch/x86/events/intel/p4.c @@ -1367,14 +1367,14 @@ static __initconst const struct x86_pmu p4_pmu =3D { =20 __init int p4_pmu_init(void) { - unsigned int low, high; + unsigned int misc; int i, reg; =20 /* If we get stripped -- indexing fails */ BUILD_BUG_ON(ARCH_P4_MAX_CCCR > INTEL_PMC_MAX_GENERIC); =20 - rdmsr(MSR_IA32_MISC_ENABLE, low, high); - if (!(low & (1 << 7))) { + rdmsrq(MSR_IA32_MISC_ENABLE, misc); + if (!(misc & MSR_IA32_MISC_ENABLE_EMON)) { pr_cont("unsupported Netburst CPU model %d ", boot_cpu_data.x86_model); return -ENODEV;