diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-02-27 16:59:05 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-02-27 16:59:05 -0500 |
commit | 6131ffaa1f091415b7a24abb01f033d9c0a727f4 (patch) | |
tree | 8983574e9458a5328a30900cb3466e3648421355 /arch/x86 | |
parent | 45e09bd51b2be1fbb86c2e3d5bb00d32744f1ecb (diff) | |
download | op-kernel-dev-6131ffaa1f091415b7a24abb01f033d9c0a727f4.zip op-kernel-dev-6131ffaa1f091415b7a24abb01f033d9c0a727f4.tar.gz |
more file_inode() open-coded instances
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/msr.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c index 4929502..ce13049 100644 --- a/arch/x86/kernel/msr.c +++ b/arch/x86/kernel/msr.c @@ -71,7 +71,7 @@ static ssize_t msr_read(struct file *file, char __user *buf, u32 __user *tmp = (u32 __user *) buf; u32 data[2]; u32 reg = *ppos; - int cpu = iminor(file->f_path.dentry->d_inode); + int cpu = iminor(file_inode(file)); int err = 0; ssize_t bytes = 0; @@ -99,7 +99,7 @@ static ssize_t msr_write(struct file *file, const char __user *buf, const u32 __user *tmp = (const u32 __user *)buf; u32 data[2]; u32 reg = *ppos; - int cpu = iminor(file->f_path.dentry->d_inode); + int cpu = iminor(file_inode(file)); int err = 0; ssize_t bytes = 0; @@ -125,7 +125,7 @@ static long msr_ioctl(struct file *file, unsigned int ioc, unsigned long arg) { u32 __user *uregs = (u32 __user *)arg; u32 regs[8]; - int cpu = iminor(file->f_path.dentry->d_inode); + int cpu = iminor(file_inode(file)); int err; switch (ioc) { @@ -171,13 +171,12 @@ static long msr_ioctl(struct file *file, unsigned int ioc, unsigned long arg) static int msr_open(struct inode *inode, struct file *file) { - unsigned int cpu; + unsigned int cpu = iminor(file_inode(file)); struct cpuinfo_x86 *c; if (!capable(CAP_SYS_RAWIO)) return -EPERM; - cpu = iminor(file->f_path.dentry->d_inode); if (cpu >= nr_cpu_ids || !cpu_online(cpu)) return -ENXIO; /* No such CPU */ |