[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y5yjT2Xu0Jd8ueQ2@google.com>
Date: Fri, 16 Dec 2022 16:56:47 +0000
From: Sean Christopherson <seanjc@...gle.com>
To: Li kunyu <kunyu@...china.com>
Cc: pbonzini@...hat.com, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kvm: kvm_main: Remove unnecessary (void*) conversions
On Tue, Dec 13, 2022, Li kunyu wrote:
> void * pointer assignment does not require a forced replacement.
>
> Signed-off-by: Li kunyu <kunyu@...china.com>
> ---
> virt/kvm/kvm_main.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index fab4d3790578..1682b269ad4a 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -3861,7 +3861,7 @@ static int create_vcpu_fd(struct kvm_vcpu *vcpu)
> #ifdef __KVM_HAVE_ARCH_VCPU_DEBUGFS
> 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));
Unrelated to your patch: doesn't this need proper RCU protection? E.g. if
KVM_RUN changes vcpu->pid between the read and dereference in pid_nr(), and puts
the last reference to the old pid.
Powered by blists - more mailing lists