mirror of
https://github.com/torvalds/linux.git
synced 2026-09-27 19:36:22 +02:00
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:
parent
d19eca5038
commit
9f29ec1f46
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user