[PATCH RFC 1/6] x86/msr: Rename msr_read() and msr_write()
From: Juergen Gross
Date: Mon Apr 20 2026 - 05:21:31 EST
Rename the existing msr_read() and msr_write() functions to
msr_do_read() and msr_do_write(), as the original names will be used
for new MSR access functions in the future.
Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
---
arch/x86/kernel/msr.c | 12 ++++++------
arch/x86/lib/msr.c | 12 ++++++------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
index 4469c784eaa0..43791746103c 100644
--- a/arch/x86/kernel/msr.c
+++ b/arch/x86/kernel/msr.c
@@ -49,8 +49,8 @@ enum allow_write_msrs {
static enum allow_write_msrs allow_writes = MSR_WRITES_DEFAULT;
-static ssize_t msr_read(struct file *file, char __user *buf,
- size_t count, loff_t *ppos)
+static ssize_t msr_do_read(struct file *file, char __user *buf,
+ size_t count, loff_t *ppos)
{
u32 __user *tmp = (u32 __user *) buf;
u32 data[2];
@@ -105,8 +105,8 @@ static int filter_write(u32 reg)
return 0;
}
-static ssize_t msr_write(struct file *file, const char __user *buf,
- size_t count, loff_t *ppos)
+static ssize_t msr_do_write(struct file *file, const char __user *buf,
+ size_t count, loff_t *ppos)
{
const u32 __user *tmp = (const u32 __user *)buf;
u32 data[2];
@@ -227,8 +227,8 @@ static int msr_open(struct inode *inode, struct file *file)
static const struct file_operations msr_fops = {
.owner = THIS_MODULE,
.llseek = no_seek_end_llseek,
- .read = msr_read,
- .write = msr_write,
+ .read = msr_do_read,
+ .write = msr_do_write,
.open = msr_open,
.unlocked_ioctl = msr_ioctl,
.compat_ioctl = msr_ioctl,
diff --git a/arch/x86/lib/msr.c b/arch/x86/lib/msr.c
index dfdd1da89f36..be6c34666743 100644
--- a/arch/x86/lib/msr.c
+++ b/arch/x86/lib/msr.c
@@ -28,7 +28,7 @@ void msrs_free(struct msr __percpu *msrs)
EXPORT_SYMBOL(msrs_free);
/**
- * msr_read - Read an MSR with error handling
+ * msr_do_read - Read an MSR with error handling
* @msr: MSR to read
* @m: value to read into
*
@@ -37,7 +37,7 @@ EXPORT_SYMBOL(msrs_free);
*
* Return: %0 for success, otherwise an error code
*/
-static int msr_read(u32 msr, struct msr *m)
+static int msr_do_read(u32 msr, struct msr *m)
{
int err;
u64 val;
@@ -50,14 +50,14 @@ static int msr_read(u32 msr, struct msr *m)
}
/**
- * msr_write - Write an MSR with error handling
+ * msr_do_write - Write an MSR with error handling
*
* @msr: MSR to write
* @m: value to write
*
* Return: %0 for success, otherwise an error code
*/
-static int msr_write(u32 msr, struct msr *m)
+static int msr_do_write(u32 msr, struct msr *m)
{
return wrmsrq_safe(msr, m->q);
}
@@ -70,7 +70,7 @@ static inline int __flip_bit(u32 msr, u8 bit, bool set)
if (bit > 63)
return err;
- err = msr_read(msr, &m);
+ err = msr_do_read(msr, &m);
if (err)
return err;
@@ -83,7 +83,7 @@ static inline int __flip_bit(u32 msr, u8 bit, bool set)
if (m1.q == m.q)
return 0;
- err = msr_write(msr, &m1);
+ err = msr_do_write(msr, &m1);
if (err)
return err;
--
2.53.0