platform/x86/amd/pmf: Use upper/lower_32_bits() in amd_pmf_set_dram_addr()

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) <superm1@kernel.org>
Co-developed-by: Patil Rajesh Reddy <Patil.Reddy@amd.com>
Signed-off-by: Patil Rajesh Reddy <Patil.Reddy@amd.com>
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Link: https://patch.msgid.link/20260723111534.1940925-6-Shyam-sundar.S-k@amd.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This commit is contained in:
Shyam Sundar S K 2026-07-23 16:45:32 +05:30 committed by Ilpo Järvinen
parent d19eca5038
commit 9f29ec1f46
No known key found for this signature in database
GPG Key ID: 59AC4F6153E5CE31

View File

@ -10,7 +10,6 @@
*/
#include <linux/array_size.h>
#include <linux/bits.h>
#include <linux/cleanup.h>
#include <linux/container_of.h>
#include <linux/device.h>
@ -19,6 +18,7 @@
#include <linux/ktime.h>
#include <linux/string.h>
#include <linux/types.h>
#include <linux/wordpart.h>
#include <linux/workqueue.h>
#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);