From nobody Sun Feb 8 11:45:10 2026 Received: from out-188.mta1.migadu.com (out-188.mta1.migadu.com [95.215.58.188]) (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 80B7F1D540 for ; Fri, 17 Jan 2025 14:49:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737125370; cv=none; b=uU41BFz4qBAKzLIehvK/pY5sa4rErv+99flxFTlf6x5oEls1PNidJi1/s2A9/F6bb3/UNf2RipLHjbuMuit+Ra7r53aHI89jTrFwZ535lU5X+9CyJA1LVTnTLGT79cPCRznqz7FChiF2PZM4g/5lpKLEuruzZYsI+xO0tl+iejw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737125370; c=relaxed/simple; bh=rX6XHjr23TAgVcH+wSWVKHQw37Y70QbDkB66MbyLErc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=CUFCWKufqkSyc21+mFyMgX5iyMxg12Z4ev87HChO/Kf/YYUOLplKCi5i+TgTXE2/uUtaKKc4ai/6MxC4XPk4tsYxJ8qKIC4mrFugg3PpJzLl+gtDuZsukLersQ43vJ2Ebxds/T4wwEl5hPnlq+gNSd4Ubul+icID6ZzoWSVxy9M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=No6RTgmM; arc=none smtp.client-ip=95.215.58.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="No6RTgmM" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1737125366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Yph2jKnQqwvNpwXySx7DD6vmw0IbakhRibw3snFyJHo=; b=No6RTgmMxrn3nhJFs1Pq4ptrNKE9p9njbGaF7ZTAs14ArpHUiANhfPVXpkB0nlpf9QLuUp xZPQxEqTHHOQzJSm/EjLW048KqRzwr57NddO7zYIGZZ83MLEwoX5eUen6Mv8eRHxR0rAcL Qo779WU4/tX64VIB423l+emmxCPU94A= From: Thorsten Blum To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , "Kirill A. Shutemov" , Tom Lendacky , Michael Roth , Ashish Kalra Cc: Thorsten Blum , Christophe JAILLET , Dave Hansen , Michael Kelley , linux-kernel@vger.kernel.org Subject: [RESEND PATCH] x86/mtrr: Use str_enabled_disabled() helper in print_mtrr_state() Date: Fri, 17 Jan 2025 15:48:59 +0100 Message-ID: <20250117144900.171684-2-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Remove hard-coded strings by using the str_enabled_disabled() helper function. Suggested-by: Christophe JAILLET Signed-off-by: Thorsten Blum --- arch/x86/kernel/cpu/mtrr/generic.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/= generic.c index 2fdfda2b60e4..6be3cade4134 100644 --- a/arch/x86/kernel/cpu/mtrr/generic.c +++ b/arch/x86/kernel/cpu/mtrr/generic.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -646,10 +647,10 @@ static void __init print_mtrr_state(void) pr_info("MTRR default type: %s\n", mtrr_attrib_to_str(mtrr_state.def_type)); if (mtrr_state.have_fixed) { - pr_info("MTRR fixed ranges %sabled:\n", - ((mtrr_state.enabled & MTRR_STATE_MTRR_ENABLED) && - (mtrr_state.enabled & MTRR_STATE_MTRR_FIXED_ENABLED)) ? - "en" : "dis"); + pr_info("MTRR fixed ranges %s:\n", + str_enabled_disabled( + (mtrr_state.enabled & MTRR_STATE_MTRR_ENABLED) && + (mtrr_state.enabled & MTRR_STATE_MTRR_FIXED_ENABLED))); print_fixed(0x00000, 0x10000, mtrr_state.fixed_ranges + 0); for (i =3D 0; i < 2; ++i) print_fixed(0x80000 + i * 0x20000, 0x04000, @@ -661,8 +662,8 @@ static void __init print_mtrr_state(void) /* tail */ print_fixed_last(); } - pr_info("MTRR variable ranges %sabled:\n", - mtrr_state.enabled & MTRR_STATE_MTRR_ENABLED ? "en" : "dis"); + pr_info("MTRR variable ranges %s:\n", + str_enabled_disabled(mtrr_state.enabled & MTRR_STATE_MTRR_ENABLED)); high_width =3D (boot_cpu_data.x86_phys_bits - (32 - PAGE_SHIFT) + 3) / 4; =20 for (i =3D 0; i < num_var_ranges; ++i) { --=20 2.48.0