iommu/arm: ipmmu-vmsa: Use 1U << 31 rather than 1 << 31
authorOleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Mon, 11 Jan 2021 10:33:55 +0000 (12:33 +0200)
committerStefano Stabellini <sstabellini@kernel.org>
Tue, 12 Jan 2021 00:31:15 +0000 (16:31 -0800)
Replace all the use of 1 << 31 with 1U << 31 to prevent undefined
behavior in the IPMMU-VMSA driver.

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/drivers/passthrough/arm/ipmmu-vmsa.c

index 346165c3fa2f64e90e4d567d2d2f465f29b8ce0c..aef358d880efe6920d64ee527d38cf8a6f26de41 100644 (file)
@@ -187,7 +187,7 @@ static DEFINE_SPINLOCK(ipmmu_devices_lock);
 #define IMCAAR               0x0004
 
 #define IMTTBCR                        0x0008
-#define IMTTBCR_EAE                    (1 << 31)
+#define IMTTBCR_EAE                    (1U << 31)
 #define IMTTBCR_PMB                    (1 << 30)
 #define IMTTBCR_SH1_NON_SHAREABLE      (0 << 28)
 #define IMTTBCR_SH1_OUTER_SHAREABLE    (2 << 28)
@@ -251,7 +251,7 @@ static DEFINE_SPINLOCK(ipmmu_devices_lock);
 #define IMUCTR(n)              ((n) < 32 ? IMUCTR0(n) : IMUCTR32(n))
 #define IMUCTR0(n)             (0x0300 + ((n) * 16))
 #define IMUCTR32(n)            (0x0600 + (((n) - 32) * 16))
-#define IMUCTR_FIXADDEN        (1 << 31)
+#define IMUCTR_FIXADDEN        (1U << 31)
 #define IMUCTR_FIXADD_MASK     (0xff << 16)
 #define IMUCTR_FIXADD_SHIFT    16
 #define IMUCTR_TTSEL_MMU(n)    ((n) << 4)