[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] hw/i386: changes towards enabling -Wshadow=local
From: |
Peter Xu |
Subject: |
Re: [PATCH] hw/i386: changes towards enabling -Wshadow=local |
Date: |
Mon, 25 Sep 2023 11:12:15 -0400 |
On Sat, Sep 23, 2023 at 08:03:34AM +0530, Ani Sinha wrote:
> diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
> index c0ce896668..c1fb69170f 100644
> --- a/hw/i386/intel_iommu.c
> +++ b/hw/i386/intel_iommu.c
> @@ -3770,9 +3770,9 @@ static void vtd_address_space_unmap(VTDAddressSpace
> *as, IOMMUNotifier *n)
> while (remain >= VTD_PAGE_SIZE) {
> IOMMUTLBEvent event;
> uint64_t mask = dma_aligned_pow2_mask(start, end, s->aw_bits);
> - uint64_t size = mask + 1;
> + uint64_t sz = mask + 1;
>
> - assert(size);
> + assert(sz);
>
> event.type = IOMMU_NOTIFIER_UNMAP;
> event.entry.iova = start;
> @@ -3784,8 +3784,8 @@ static void vtd_address_space_unmap(VTDAddressSpace
> *as, IOMMUNotifier *n)
>
> memory_region_notify_iommu_one(n, &event);
>
> - start += size;
> - remain -= size;
> + start += sz;
> + remain -= sz;
> }
>
> assert(!remain);
Ani,
I've got a small patch for this hunk already:
20230922160410.138786-1-peterx@redhat.com">https://lore.kernel.org/r/20230922160410.138786-1-peterx@redhat.com
Wouldn't hurt to merge both, though.. or just drop the other one.
Reviewed-by: Peter Xu <peterx@redhat.com>
Thanks,
--
Peter Xu