From 9f29ec1f46d03a7b633c5d9a668ece059d539d4c Mon Sep 17 00:00:00 2001 From: Shyam Sundar S K Date: Thu, 23 Jul 2026 16:45:32 +0530 Subject: [PATCH] platform/x86/amd/pmf: Use upper/lower_32_bits() in amd_pmf_set_dram_addr() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the open coded manual bit shifting used to split a 64-bit physical address into its high and low 32-bit halves with the standard kernel helpers upper_32_bits() and lower_32_bits(). No functional changes. Reviewed-by: Mario Limonciello (AMD) Co-developed-by: Patil Rajesh Reddy Signed-off-by: Patil Rajesh Reddy Signed-off-by: Shyam Sundar S K Link: https://patch.msgid.link/20260723111534.1940925-6-Shyam-sundar.S-k@amd.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen --- drivers/platform/x86/amd/pmf/metrics.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/amd/pmf/metrics.c b/drivers/platform/x86/amd/pmf/metrics.c index a5444ad52cf4..8ee60d455ec3 100644 --- a/drivers/platform/x86/amd/pmf/metrics.c +++ b/drivers/platform/x86/amd/pmf/metrics.c @@ -10,7 +10,6 @@ */ #include -#include #include #include #include @@ -19,6 +18,7 @@ #include #include #include +#include #include #include "pmf.h" @@ -82,8 +82,8 @@ int amd_pmf_set_dram_addr(struct amd_pmf_dev *dev, bool alloc_buffer) } phys_addr = virt_to_phys(dev->buf); - hi = phys_addr >> 32; - low = phys_addr & GENMASK(31, 0); + hi = upper_32_bits(phys_addr); + low = lower_32_bits(phys_addr); amd_pmf_send_cmd(dev, SET_DRAM_ADDR_HIGH, SET_CMD, hi, NULL); amd_pmf_send_cmd(dev, SET_DRAM_ADDR_LOW, SET_CMD, low, NULL);