> -----Original Message-----
> From: Jan Beulich [mailto:[email protected]]
> Sent: 26 November 2018 11:49
> To: Paul Durrant <[email protected]>
> Cc: Brian Woods <[email protected]>; Suravee Suthikulpanit
> <[email protected]>; xen-devel <xen-
> [email protected]>
> Subject: Re: [Xen-devel] [PATCH v2 2/2] amd-iommu: replace occurrences of
> u<N> with uint<N>_t...
> 
> >>> On 26.11.18 at 12:32, <[email protected]> wrote:
> > @@ -306,7 +307,8 @@ void iommu_dte_set_guest_cr3(u32 *dte, u16 dom_id,
> u64 gcr3,
> >  uint64_t amd_iommu_get_address_from_pte(void *pte)
> >  {
> >      uint32_t *entry = pte;
> > -    uint64_t addr_lo, addr_hi, ptr;
> > +    uint32_t addr_lo, addr_hi;
> > +    uint64_t ptr;
> >
> >      addr_lo = get_field_from_reg_u32(entry[0],
> >                                       IOMMU_PTE_ADDR_LOW_MASK,
> > @@ -316,29 +318,30 @@ uint64_t amd_iommu_get_address_from_pte(void *pte)
> >                                       IOMMU_PTE_ADDR_HIGH_MASK,
> >                                       IOMMU_PTE_ADDR_HIGH_SHIFT);
> >
> > -    ptr = (addr_hi << 32) | (addr_lo << PAGE_SHIFT);
> > +    ptr = ((uint64_t)addr_hi << 32) |
> > +          ((uint64_t)addr_lo << PAGE_SHIFT);
> >      return ptr;
> >  }
> 
> This is actually an increase in casts. I assume you've done this for
> consistency, but it would have been nice if the description said so.

Yes, it was indeed for consistency. Still a net reduction overall but, yes, the 
comment could have been clearer.

> Anyway,
> Reviewed-by: Jan Beulich <[email protected]>
> 

Thanks,

  Paul

> Jan
> 


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to