Skip to content
Commit 29fcea8c authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Joerg Roedel
Browse files

iommu: Fix integer truncation

On 32-bit architectures, phys_addr_t may be different from dma_add_t,
both smaller and bigger. This can lead to an overflow during an assignment
that clang warns about:

drivers/iommu/dma-iommu.c:230:10: error: implicit conversion from 'dma_addr_t' (aka 'unsigned long long') to
      'phys_addr_t' (aka 'unsigned int') changes value from 18446744073709551615 to 4294967295 [-Werror,-Wconstant-conversion]

Use phys_addr_t here because that is the type that the variable was
declared as.

Fixes: aadad097

 ("iommu/dma: Reserve IOVA for PCIe inaccessible DMA address")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 58b55c85
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment