OSDN Git Service

memory: tegra: Fix compilation warnings on 64bit platforms
authorDmitry Osipenko <digetx@gmail.com>
Tue, 1 Jun 2021 02:31:12 +0000 (05:31 +0300)
committerThierry Reding <treding@nvidia.com>
Tue, 1 Jun 2021 11:42:53 +0000 (13:42 +0200)
Fix compilation warning on 64bit platforms caused by implicit promotion
of 32bit signed integer to a 64bit unsigned value which happens after
enabling compile-testing of the EMC drivers.

Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/memory/tegra/tegra124-emc.c
drivers/memory/tegra/tegra30-emc.c

index 5699d90..a21ca8e 100644 (file)
 #define EMC_PUTERM_ADJ                         0x574
 
 #define DRAM_DEV_SEL_ALL                       0
-#define DRAM_DEV_SEL_0                         (2 << 30)
-#define DRAM_DEV_SEL_1                         (1 << 30)
+#define DRAM_DEV_SEL_0                         BIT(31)
+#define DRAM_DEV_SEL_1                         BIT(30)
 
 #define EMC_CFG_POWER_FEATURES_MASK            \
        (EMC_CFG_DYN_SREF | EMC_CFG_DRAM_ACPD | EMC_CFG_DRAM_CLKSTOP_SR | \
index 829f6d6..a2f2738 100644 (file)
 #define EMC_SELF_REF_CMD_ENABLED               BIT(0)
 
 #define DRAM_DEV_SEL_ALL                       (0 << 30)
-#define DRAM_DEV_SEL_0                         (2 << 30)
-#define DRAM_DEV_SEL_1                         (1 << 30)
+#define DRAM_DEV_SEL_0                         BIT(31)
+#define DRAM_DEV_SEL_1                         BIT(30)
 #define DRAM_BROADCAST(num) \
        ((num) > 1 ? DRAM_DEV_SEL_ALL : DRAM_DEV_SEL_0)