Hi Ricardo, On 10/5/21 3:19 AM, Ricardo Koller wrote: > There are no more users of vgic_check_ioaddr(). Move its checks to > vgic_check_iorange() and then remove it. > > Signed-off-by: Ricardo Koller <ricarkol@xxxxxxxxxx> Reviewed-by: Eric Auger <eric.auger@xxxxxxxxxx> Eric > --- > arch/arm64/kvm/vgic/vgic-kvm-device.c | 26 ++++---------------------- > arch/arm64/kvm/vgic/vgic.h | 3 --- > 2 files changed, 4 insertions(+), 25 deletions(-) > > diff --git a/arch/arm64/kvm/vgic/vgic-kvm-device.c b/arch/arm64/kvm/vgic/vgic-kvm-device.c > index 08ae34b1a986..0d000d2fe8d2 100644 > --- a/arch/arm64/kvm/vgic/vgic-kvm-device.c > +++ b/arch/arm64/kvm/vgic/vgic-kvm-device.c > @@ -14,38 +14,20 @@ > > /* common helpers */ > > -int vgic_check_ioaddr(struct kvm *kvm, phys_addr_t *ioaddr, > - phys_addr_t addr, phys_addr_t alignment) > -{ > - if (addr & ~kvm_phys_mask(kvm)) > - return -E2BIG; > - > - if (!IS_ALIGNED(addr, alignment)) > - return -EINVAL; > - > - if (!IS_VGIC_ADDR_UNDEF(*ioaddr)) > - return -EEXIST; > - > - return 0; > -} > - > int vgic_check_iorange(struct kvm *kvm, phys_addr_t ioaddr, > phys_addr_t addr, phys_addr_t alignment, > phys_addr_t size) > { > - int ret; > - > - ret = vgic_check_ioaddr(kvm, &ioaddr, addr, alignment); > - if (ret) > - return ret; > + if (!IS_VGIC_ADDR_UNDEF(ioaddr)) > + return -EEXIST; > > - if (!IS_ALIGNED(size, alignment)) > + if (!IS_ALIGNED(addr, alignment) || !IS_ALIGNED(size, alignment)) > return -EINVAL; > > if (addr + size < addr) > return -EINVAL; > > - if (addr + size > kvm_phys_size(kvm)) > + if (addr & ~kvm_phys_mask(kvm) || addr + size > kvm_phys_size(kvm)) > return -E2BIG; > > return 0; > diff --git a/arch/arm64/kvm/vgic/vgic.h b/arch/arm64/kvm/vgic/vgic.h > index 4be01c38e8f1..3fd6c86a7ef3 100644 > --- a/arch/arm64/kvm/vgic/vgic.h > +++ b/arch/arm64/kvm/vgic/vgic.h > @@ -172,9 +172,6 @@ void vgic_kick_vcpus(struct kvm *kvm); > void vgic_irq_handle_resampling(struct vgic_irq *irq, > bool lr_deactivated, bool lr_pending); > > -int vgic_check_ioaddr(struct kvm *kvm, phys_addr_t *ioaddr, > - phys_addr_t addr, phys_addr_t alignment); > - > int vgic_check_iorange(struct kvm *kvm, phys_addr_t ioaddr, > phys_addr_t addr, phys_addr_t alignment, > phys_addr_t size);