summaryrefslogtreecommitdiffstats
path: root/virt/kvm/arm/vgic/vgic.c
diff options
context:
space:
mode:
authorMarc Zyngier2016-07-17 12:27:23 +0200
committerMarc Zyngier2016-07-18 19:15:16 +0200
commitd97594e6bc1b4aaad3ccae3ef678513b63dd5221 (patch)
tree921513cb42ad71bfb73eb1652d4158e3492f60df /virt/kvm/arm/vgic/vgic.c
parentirqchip/gicv3-its: Restore all cacheability attributes (diff)
downloadkernel-qcow2-linux-d97594e6bc1b4aaad3ccae3ef678513b63dd5221.tar.gz
kernel-qcow2-linux-d97594e6bc1b4aaad3ccae3ef678513b63dd5221.tar.xz
kernel-qcow2-linux-d97594e6bc1b4aaad3ccae3ef678513b63dd5221.zip
KVM: arm64: vgic-its: Generalize use of vgic_get_irq_kref
Instead of sprinkling raw kref_get() calls everytime we cannot do a normal vgic_get_irq(), use the existing vgic_get_irq_kref(), which does the same thing and is paired with a vgic_put_irq(). vgic_get_irq_kref is moved to vgic.h in order to be easily shared. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'virt/kvm/arm/vgic/vgic.c')
-rw-r--r--virt/kvm/arm/vgic/vgic.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/virt/kvm/arm/vgic/vgic.c b/virt/kvm/arm/vgic/vgic.c
index 424cb9ceebd9..39f3358c6d91 100644
--- a/virt/kvm/arm/vgic/vgic.c
+++ b/virt/kvm/arm/vgic/vgic.c
@@ -71,7 +71,7 @@ static struct vgic_irq *vgic_get_lpi(struct kvm *kvm, u32 intid)
* This increases the refcount, the caller is expected to
* call vgic_put_irq() later once it's finished with the IRQ.
*/
- kref_get(&irq->refcount);
+ vgic_get_irq_kref(irq);
goto out_unlock;
}
irq = NULL;
@@ -106,14 +106,6 @@ struct vgic_irq *vgic_get_irq(struct kvm *kvm, struct kvm_vcpu *vcpu,
return NULL;
}
-static void vgic_get_irq_kref(struct vgic_irq *irq)
-{
- if (irq->intid < VGIC_MIN_LPI)
- return;
-
- kref_get(&irq->refcount);
-}
-
/*
* We can't do anything in here, because we lack the kvm pointer to
* lock and remove the item from the lpi_list. So we keep this function