diff mbox series

[3/3] kvm: don't redefine flags as something else

Message ID 20181017170554.18841-4-bigeasy@linutronix.de (mailing list archive)
State New, archived
Headers show
Series Let sparse check for shadowed variables | expand

Commit Message

Sebastian Andrzej Siewior Oct. 17, 2018, 5:05 p.m. UTC
The function irqfd_wakeup() has flags defined as __poll_t and then it
has additional flags which is used for irqflags.

Redefine the inner flags variable as iflags so it does not shadow the
outer flags.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: kvm@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 virt/kvm/eventfd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Paolo Bonzini Oct. 17, 2018, 5:06 p.m. UTC | #1
On 17/10/2018 19:05, Sebastian Andrzej Siewior wrote:
> The function irqfd_wakeup() has flags defined as __poll_t and then it
> has additional flags which is used for irqflags.
> 
> Redefine the inner flags variable as iflags so it does not shadow the
> outer flags.
> 
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: "Radim Krčmář" <rkrcmar@redhat.com>
> Cc: kvm@vger.kernel.org
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
>  virt/kvm/eventfd.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
> index b20b751286fc6..d15a51622d53e 100644
> --- a/virt/kvm/eventfd.c
> +++ b/virt/kvm/eventfd.c
> @@ -214,9 +214,9 @@ irqfd_wakeup(wait_queue_entry_t *wait, unsigned mode, int sync, void *key)
>  
>  	if (flags & EPOLLHUP) {
>  		/* The eventfd is closing, detach from KVM */
> -		unsigned long flags;
> +		unsigned long iflags;
>  
> -		spin_lock_irqsave(&kvm->irqfds.lock, flags);
> +		spin_lock_irqsave(&kvm->irqfds.lock, iflags);
>  
>  		/*
>  		 * We must check if someone deactivated the irqfd before
> @@ -230,7 +230,7 @@ irqfd_wakeup(wait_queue_entry_t *wait, unsigned mode, int sync, void *key)
>  		if (irqfd_is_active(irqfd))
>  			irqfd_deactivate(irqfd);
>  
> -		spin_unlock_irqrestore(&kvm->irqfds.lock, flags);
> +		spin_unlock_irqrestore(&kvm->irqfds.lock, iflags);
>  	}
>  
>  	return 0;
> 

Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Sebastian Andrzej Siewior March 13, 2019, 8:58 a.m. UTC | #2
On 2018-10-17 19:06:33 [+0200], Paolo Bonzini wrote:
> On 17/10/2018 19:05, Sebastian Andrzej Siewior wrote:
> > The function irqfd_wakeup() has flags defined as __poll_t and then it
> > has additional flags which is used for irqflags.
> > 
> > Redefine the inner flags variable as iflags so it does not shadow the
> > outer flags.
> > 
> > Cc: Paolo Bonzini <pbonzini@redhat.com>
> > Cc: "Radim Krčmář" <rkrcmar@redhat.com>
> > Cc: kvm@vger.kernel.org
> > Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Acked-by: Paolo Bonzini <pbonzini@redhat.com>

this touches only kvm and was acked by a kvm person. What did it miss to
get applied? :)

Sebastian
Paolo Bonzini March 13, 2019, 11:06 a.m. UTC | #3
On 13/03/19 09:58, Sebastian Andrzej Siewior wrote:
> On 2018-10-17 19:06:33 [+0200], Paolo Bonzini wrote:
>> On 17/10/2018 19:05, Sebastian Andrzej Siewior wrote:
>>> The function irqfd_wakeup() has flags defined as __poll_t and then it
>>> has additional flags which is used for irqflags.
>>>
>>> Redefine the inner flags variable as iflags so it does not shadow the
>>> outer flags.
>>>
>>> Cc: Paolo Bonzini <pbonzini@redhat.com>
>>> Cc: "Radim Krčmář" <rkrcmar@redhat.com>
>>> Cc: kvm@vger.kernel.org
>>> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
>> Acked-by: Paolo Bonzini <pbonzini@redhat.com>
> 
> this touches only kvm and was acked by a kvm person. What did it miss to
> get applied? :)

I was expecting it to be applied together with the other patches.  I can
queue it too.

Paolo
diff mbox series

Patch

diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
index b20b751286fc6..d15a51622d53e 100644
--- a/virt/kvm/eventfd.c
+++ b/virt/kvm/eventfd.c
@@ -214,9 +214,9 @@  irqfd_wakeup(wait_queue_entry_t *wait, unsigned mode, int sync, void *key)
 
 	if (flags & EPOLLHUP) {
 		/* The eventfd is closing, detach from KVM */
-		unsigned long flags;
+		unsigned long iflags;
 
-		spin_lock_irqsave(&kvm->irqfds.lock, flags);
+		spin_lock_irqsave(&kvm->irqfds.lock, iflags);
 
 		/*
 		 * We must check if someone deactivated the irqfd before
@@ -230,7 +230,7 @@  irqfd_wakeup(wait_queue_entry_t *wait, unsigned mode, int sync, void *key)
 		if (irqfd_is_active(irqfd))
 			irqfd_deactivate(irqfd);
 
-		spin_unlock_irqrestore(&kvm->irqfds.lock, flags);
+		spin_unlock_irqrestore(&kvm->irqfds.lock, iflags);
 	}
 
 	return 0;