On 10/27/2017 09:19 AM, Mark Cave-Ayland wrote:
[...]
> +/* Called from RCU critical section */
> +static IOMMUTLBEntry sun4m_translate_iommu(IOMMUMemoryRegion *iommu,
> +                                           hwaddr addr,
> +                                           IOMMUAccessFlags flags)
> +{
> +    IOMMUState *is = container_of(iommu, IOMMUState, iommu);
> +    hwaddr page, pa;
> +    int is_write = (flags & IOMMU_WO) ? 1 : 0;
> +    uint32_t pte;
> +    IOMMUTLBEntry ret = {
> +        .target_as = &address_space_memory,
> +        .iova = 0,
> +        .translated_addr = 0,
> +        .addr_mask = ~(hwaddr)0,

I never thought of it! I would have write (hwaddr)~0 but your way is
much cleaner.

> +        .perm = IOMMU_NONE,
> +    };
[...]

Reply via email to