aboutsummaryrefslogtreecommitdiff
path: root/virt
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2016-07-17 12:15:19 +0100
committerMarc Zyngier <marc.zyngier@arm.com>2016-07-18 18:15:17 +0100
commitb90338b7cbb7c8cad8dbd3c4de4e64180ce0d88b (patch)
treef08c54db102077143b98a8dc01fae4a41a2a1b5f /virt
parent7e3963a51563d844fcd3bdc13e2847561b15e8de (diff)
downloadlinux-stericsson-b90338b7cbb7c8cad8dbd3c4de4e64180ce0d88b.tar.gz
KVM: arm64: vgic-its: Fix misleading nr_entries in vgic_its_check_device_id
The nr_entries variable in vgic_its_check_device_id actually describe the size of the L1 table, and not the number of entries in this table. Rename it to l1_tbl_size, so that we can now change the code with a better understanding of what is what. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/arm/vgic/vgic-its.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c
index 2ac5927b1d91..268a0c7ea3a5 100644
--- a/virt/kvm/arm/vgic/vgic-its.c
+++ b/virt/kvm/arm/vgic/vgic-its.c
@@ -687,18 +687,18 @@ static bool vgic_its_check_device_id(struct kvm *kvm, struct vgic_its *its,
int device_id)
{
u64 r = its->baser_device_table;
- int nr_entries = GITS_BASER_NR_PAGES(r) * SZ_64K;
+ int l1_tbl_size = GITS_BASER_NR_PAGES(r) * SZ_64K;
int index;
u64 indirect_ptr;
gfn_t gfn;
if (!(r & GITS_BASER_INDIRECT))
- return device_id < (nr_entries / GITS_BASER_ENTRY_SIZE(r));
+ return device_id < (l1_tbl_size / GITS_BASER_ENTRY_SIZE(r));
/* calculate and check the index into the 1st level */
index = device_id / (SZ_64K / GITS_BASER_ENTRY_SIZE(r));
- if (index >= (nr_entries / sizeof(u64)))
+ if (index >= (l1_tbl_size / sizeof(u64)))
return false;
/* Each 1st level entry is represented by a 64-bit value. */