Skip to content

Commit

Permalink
iommu/omap: Fix pointer cast -Wpointer-to-int-cast warnings on 64 bit
Browse files Browse the repository at this point in the history
pointers should be casted to unsigned long to avoid
-Wpointer-to-int-cast warnings when compiling on 64-bit platform (e.g.
with COMPILE_TEST):

    drivers/iommu/omap-iommu.c: In function ‘omap2_iommu_enable’:
    drivers/iommu/omap-iommu.c:170:25: warning:
        cast from pointer to integer of different size [-Wpointer-to-int-cast]
      if (!obj->iopgd || !IS_ALIGNED((u32)obj->iopgd,  SZ_16K))
                             ^

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
  • Loading branch information
Krzysztof Kozlowski authored and Joerg Roedel committed Mar 4, 2020
1 parent f8788d8 commit f2ce16c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iommu/omap-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ static int omap2_iommu_enable(struct omap_iommu *obj)
{
u32 l, pa;

if (!obj->iopgd || !IS_ALIGNED((u32)obj->iopgd, SZ_16K))
if (!obj->iopgd || !IS_ALIGNED((unsigned long)obj->iopgd, SZ_16K))
return -EINVAL;

pa = virt_to_phys(obj->iopgd);
Expand Down

0 comments on commit f2ce16c

Please sign in to comment.