Skip to content

Commit 14aa40a

Browse files
likunyursean-jc
authored andcommitted
kvm: kvm_main: Remove unnecessary (void*) conversions
void * pointer assignment does not require a forced replacement. Signed-off-by: Li kunyu <kunyu@nfschina.com> Link: https://lore.kernel.org/r/20221213080236.3969-1-kunyu@nfschina.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent d8708b8 commit 14aa40a

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

virt/kvm/kvm_main.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3866,7 +3866,7 @@ static int create_vcpu_fd(struct kvm_vcpu *vcpu)
38663866
#ifdef __KVM_HAVE_ARCH_VCPU_DEBUGFS
38673867
static int vcpu_get_pid(void *data, u64 *val)
38683868
{
3869-
struct kvm_vcpu *vcpu = (struct kvm_vcpu *) data;
3869+
struct kvm_vcpu *vcpu = data;
38703870
*val = pid_nr(rcu_access_pointer(vcpu->pid));
38713871
return 0;
38723872
}
@@ -5572,8 +5572,7 @@ static int kvm_debugfs_open(struct inode *inode, struct file *file,
55725572
const char *fmt)
55735573
{
55745574
int ret;
5575-
struct kvm_stat_data *stat_data = (struct kvm_stat_data *)
5576-
inode->i_private;
5575+
struct kvm_stat_data *stat_data = inode->i_private;
55775576

55785577
/*
55795578
* 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,
55945593

55955594
static int kvm_debugfs_release(struct inode *inode, struct file *file)
55965595
{
5597-
struct kvm_stat_data *stat_data = (struct kvm_stat_data *)
5598-
inode->i_private;
5596+
struct kvm_stat_data *stat_data = inode->i_private;
55995597

56005598
simple_attr_release(inode, file);
56015599
kvm_put_kvm(stat_data->kvm);
@@ -5644,7 +5642,7 @@ static int kvm_clear_stat_per_vcpu(struct kvm *kvm, size_t offset)
56445642
static int kvm_stat_data_get(void *data, u64 *val)
56455643
{
56465644
int r = -EFAULT;
5647-
struct kvm_stat_data *stat_data = (struct kvm_stat_data *)data;
5645+
struct kvm_stat_data *stat_data = data;
56485646

56495647
switch (stat_data->kind) {
56505648
case KVM_STAT_VM:
@@ -5663,7 +5661,7 @@ static int kvm_stat_data_get(void *data, u64 *val)
56635661
static int kvm_stat_data_clear(void *data, u64 val)
56645662
{
56655663
int r = -EFAULT;
5666-
struct kvm_stat_data *stat_data = (struct kvm_stat_data *)data;
5664+
struct kvm_stat_data *stat_data = data;
56675665

56685666
if (val)
56695667
return -EINVAL;

0 commit comments

Comments
 (0)