iommu: Use bitmap to calculate page size in iommu_pgsize()
authorWill Deacon <will@kernel.org>
Wed, 16 Jun 2021 13:38:46 +0000 (06:38 -0700)
committerJoerg Roedel <jroedel@suse.de>
Mon, 26 Jul 2021 10:37:07 +0000 (12:37 +0200)
commite7d6fff6b3d34230bac1b2c2607646d7b8638cb7
tree020f9f45d89f6343b0cec7ba27b0f2b6c4f31a55
parent910c4406ccc9613de0a54abf910edc4bf8a575c0
iommu: Use bitmap to calculate page size in iommu_pgsize()

Avoid the potential for shifting values by amounts greater than the
width of their type by using a bitmap to compute page size in
iommu_pgsize().

Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
Signed-off-by: Georgi Djakov <quic_c_gdjako@quicinc.com>
Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/1623850736-389584-6-git-send-email-quic_c_gdjako@quicinc.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/iommu.c