kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: remove redundant assignment to variable r
@ 2020-04-10 11:35 Colin King
  2020-04-15 14:56 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2020-04-10 11:35 UTC (permalink / raw)
  To: Paolo Bonzini, kvm; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The variable r is being assigned  with a value that is never read
and it is being updated later with a new value.  The initialization is
redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 virt/kvm/kvm_main.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 74bdb7bf3295..03571f6acaa8 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -3160,7 +3160,6 @@ static long kvm_vcpu_ioctl(struct file *filp,
 	case KVM_SET_REGS: {
 		struct kvm_regs *kvm_regs;
 
-		r = -ENOMEM;
 		kvm_regs = memdup_user(argp, sizeof(*kvm_regs));
 		if (IS_ERR(kvm_regs)) {
 			r = PTR_ERR(kvm_regs);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] KVM: remove redundant assignment to variable r
  2020-04-10 11:35 [PATCH] KVM: remove redundant assignment to variable r Colin King
@ 2020-04-15 14:56 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2020-04-15 14:56 UTC (permalink / raw)
  To: Colin King, kvm; +Cc: kernel-janitors, linux-kernel

On 10/04/20 13:35, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable r is being assigned  with a value that is never read
> and it is being updated later with a new value.  The initialization is
> redundant and can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  virt/kvm/kvm_main.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 74bdb7bf3295..03571f6acaa8 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -3160,7 +3160,6 @@ static long kvm_vcpu_ioctl(struct file *filp,
>  	case KVM_SET_REGS: {
>  		struct kvm_regs *kvm_regs;
>  
> -		r = -ENOMEM;
>  		kvm_regs = memdup_user(argp, sizeof(*kvm_regs));
>  		if (IS_ERR(kvm_regs)) {
>  			r = PTR_ERR(kvm_regs);
> 

Queued, thanks.

Paolo


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-15 14:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-10 11:35 [PATCH] KVM: remove redundant assignment to variable r Colin King
2020-04-15 14:56 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).