From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-183.mta1.migadu.com (out-183.mta1.migadu.com [95.215.58.183]) (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 BF138207E19 for ; Fri, 10 Jan 2025 08:41:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.183 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736498499; cv=none; b=uThc/Z7cSnBPB7smb9LpeVOVvfuTKTVQOBOMOgnizIfGV+bFzr/dtmOsU+27SotO5h5Tx4T/vlECCnGyc5vj93NBDrVmVCH5QH9BBcien0s8mV6WoR8AjT0/Y4Ba4Nac60f3UzpjLvr2mvM/CmkCw+BkHi2BMUdovdAffDPc4dI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736498499; c=relaxed/simple; bh=RUXyKWlnWgDpKmz9P9LiuF9CDwoD6ZiPZiGYqLrwBW4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=QnfwiXmAIGpbKdDD4HM/MSzDAm/F4WnDzE/OM726rdl4T65Jxw3c2wCSWqGAuHsKi/RthLGJ/8i32ERnaLr9Ywo/QUvR2rlt9c6RCKb1tPsFGNCuY8Jc05f7Kc3uG+zt6CQfyxFVHZUOi4fEjKqSzHNO0s9faPfKYittp2hTs/U= 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=DlSX9wwt; arc=none smtp.client-ip=95.215.58.183 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="DlSX9wwt" 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=1736498494; 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=p3DilMLpvJ8bUu+cxNMVPIvlbzr9mcZV37R0bmOkQiA=; b=DlSX9wwtRt6pJLwHjs6dwYe+XIvsEwnYwODKew6394KQGOq2oliXMudM9lKZ13VamGTz9Y Ngt2Y81V6Q4nWBtylONo8fpMSxvdJE5JtFthUtWhtXFS5HXkW7EpgMQEB2FBq6hD/36Mjx wXKklkgSWGKI7Sl4PMUh37N0w1fBpeY= From: Thorsten Blum To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Tom Lendacky , Michael Roth , Ashish Kalra Cc: Thorsten Blum , Christophe JAILLET , linux-kernel@vger.kernel.org Subject: [PATCH] x86/mtrr: Use str_enabled_disabled() helper in print_mtrr_state() Date: Fri, 10 Jan 2025 09:40:26 +0100 Message-ID: <20250110084028.239003-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: 8bit X-Migadu-Flow: FLOW_OUT 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 7b29ebda024f..913ee5a774fe 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 = 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 = (boot_cpu_data.x86_phys_bits - (32 - PAGE_SHIFT) + 3) / 4; for (i = 0; i < num_var_ranges; ++i) { -- 2.47.1