Commit 14aa40a1 authored by Li kunyu's avatar Li kunyu Committed by Sean Christopherson

kvm: kvm_main: Remove unnecessary (void*) conversions

void * pointer assignment does not require a forced replacement.
Signed-off-by: default avatarLi kunyu <kunyu@nfschina.com>
Link: https://lore.kernel.org/r/20221213080236.3969-1-kunyu@nfschina.comSigned-off-by: default avatarSean Christopherson <seanjc@google.com>
parent d8708b80
...@@ -3866,7 +3866,7 @@ static int create_vcpu_fd(struct kvm_vcpu *vcpu) ...@@ -3866,7 +3866,7 @@ static int create_vcpu_fd(struct kvm_vcpu *vcpu)
#ifdef __KVM_HAVE_ARCH_VCPU_DEBUGFS #ifdef __KVM_HAVE_ARCH_VCPU_DEBUGFS
static int vcpu_get_pid(void *data, u64 *val) static int vcpu_get_pid(void *data, u64 *val)
{ {
struct kvm_vcpu *vcpu = (struct kvm_vcpu *) data; struct kvm_vcpu *vcpu = data;
*val = pid_nr(rcu_access_pointer(vcpu->pid)); *val = pid_nr(rcu_access_pointer(vcpu->pid));
return 0; return 0;
} }
...@@ -5572,8 +5572,7 @@ static int kvm_debugfs_open(struct inode *inode, struct file *file, ...@@ -5572,8 +5572,7 @@ static int kvm_debugfs_open(struct inode *inode, struct file *file,
const char *fmt) const char *fmt)
{ {
int ret; int ret;
struct kvm_stat_data *stat_data = (struct kvm_stat_data *) struct kvm_stat_data *stat_data = inode->i_private;
inode->i_private;
/* /*
* The debugfs files are a reference to the kvm struct which * The debugfs files are a reference to the kvm struct which
...@@ -5594,8 +5593,7 @@ static int kvm_debugfs_open(struct inode *inode, struct file *file, ...@@ -5594,8 +5593,7 @@ static int kvm_debugfs_open(struct inode *inode, struct file *file,
static int kvm_debugfs_release(struct inode *inode, struct file *file) static int kvm_debugfs_release(struct inode *inode, struct file *file)
{ {
struct kvm_stat_data *stat_data = (struct kvm_stat_data *) struct kvm_stat_data *stat_data = inode->i_private;
inode->i_private;
simple_attr_release(inode, file); simple_attr_release(inode, file);
kvm_put_kvm(stat_data->kvm); kvm_put_kvm(stat_data->kvm);
...@@ -5644,7 +5642,7 @@ static int kvm_clear_stat_per_vcpu(struct kvm *kvm, size_t offset) ...@@ -5644,7 +5642,7 @@ static int kvm_clear_stat_per_vcpu(struct kvm *kvm, size_t offset)
static int kvm_stat_data_get(void *data, u64 *val) static int kvm_stat_data_get(void *data, u64 *val)
{ {
int r = -EFAULT; int r = -EFAULT;
struct kvm_stat_data *stat_data = (struct kvm_stat_data *)data; struct kvm_stat_data *stat_data = data;
switch (stat_data->kind) { switch (stat_data->kind) {
case KVM_STAT_VM: case KVM_STAT_VM:
...@@ -5663,7 +5661,7 @@ static int kvm_stat_data_get(void *data, u64 *val) ...@@ -5663,7 +5661,7 @@ static int kvm_stat_data_get(void *data, u64 *val)
static int kvm_stat_data_clear(void *data, u64 val) static int kvm_stat_data_clear(void *data, u64 val)
{ {
int r = -EFAULT; int r = -EFAULT;
struct kvm_stat_data *stat_data = (struct kvm_stat_data *)data; struct kvm_stat_data *stat_data = data;
if (val) if (val)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment