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

[xen master] xen/iommu: smmu: Silence clang in arm_smmu_device_dt_probe()



commit 264aa183ad85b2779b27d1312724a291259ccc9f
Author:     Julien Grall <jgrall@xxxxxxxxxx>
AuthorDate: Fri Apr 2 16:51:06 2021 +0100
Commit:     Julien Grall <jgrall@xxxxxxxxxx>
CommitDate: Tue Apr 13 18:57:59 2021 +0100

    xen/iommu: smmu: Silence clang in arm_smmu_device_dt_probe()
    
    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 initially casting to (uintptr_t) and then
    enum.
    
    Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>
    Acked-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
 xen/drivers/passthrough/arm/smmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/drivers/passthrough/arm/smmu.c 
b/xen/drivers/passthrough/arm/smmu.c
index 20ac672e91..fab7be8b48 100644
--- a/xen/drivers/passthrough/arm/smmu.c
+++ b/xen/drivers/passthrough/arm/smmu.c
@@ -2382,7 +2382,7 @@ static int arm_smmu_device_dt_probe(struct 
platform_device *pdev)
        smmu->dev = dev;
 
        of_id = of_match_node(arm_smmu_of_match, dev->of_node);
-       smmu->version = (enum arm_smmu_arch_version)of_id->data;
+       smmu->version = (enum arm_smmu_arch_version)(uintptr_t)of_id->data;
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        smmu->base = devm_ioremap_resource(dev, res);
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

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