[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xen/iommu: smmu: Rework how the SMMU version is detected



On 24/12/2020 16:49, Julien Grall wrote:
> From: Julien Grall <jgrall@xxxxxxxxxx>
>
> Clang 11 will throw the following error:
>
> smmu.c:2284:18: error: cast to smaller integer type 'enum 
> arm_smmu_arch_version' from 'const void *' 
> [-Werror,-Wvoid-pointer-to-enum-cast]
>         smmu->version = (enum arm_smmu_arch_version)of_id->data;
>                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> The error can be prevented by introduce static variable for each SMMU
> version and store a pointer for each of them.
>
> Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>

You can also fix this by casting through (uintptr_t) instead of (enum
arm_smmu_arch_version), which wouldn't involve an extra indirection.

Alternatively, you could modify dt_device_match to union void *data with
uintptr_t val for when you want to actually pass non-pointer data.

~Andrew



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.