lkml.org 
[lkml]   [2019]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH V2 12/15] ARM: vexpress: cleanup cppcheck shifting error
Date
[arch/arm/mach-vexpress/spc.c:366]: (error) Shifting signed 32-bit value
by 31 bits is undefined behaviour

Signed-off-by: Phong Tran <tranmanphong@gmail.com>
---
arch/arm/mach-vexpress/spc.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-vexpress/spc.c b/arch/arm/mach-vexpress/spc.c
index 0f5381d13494..425ce633667a 100644
--- a/arch/arm/mach-vexpress/spc.c
+++ b/arch/arm/mach-vexpress/spc.c
@@ -57,8 +57,8 @@

/* SPC CPU/cluster reset statue */
#define STANDBYWFI_STAT 0x3c
-#define STANDBYWFI_STAT_A15_CPU_MASK(cpu) (1 << (cpu))
-#define STANDBYWFI_STAT_A7_CPU_MASK(cpu) (1 << (3 + (cpu)))
+#define STANDBYWFI_STAT_A15_CPU_MASK(cpu) BIT((cpu))
+#define STANDBYWFI_STAT_A7_CPU_MASK(cpu) BIT((3 + (cpu)))

/* SPC system config interface registers */
#define SYSCFG_WDATA 0x70
@@ -69,7 +69,7 @@
#define A7_PERFVAL_BASE 0xC30

/* Config interface control bits */
-#define SYSCFG_START (1 << 31)
+#define SYSCFG_START BIT(31)
#define SYSCFG_SCC (6 << 20)
#define SYSCFG_STAT (14 << 20)

@@ -90,8 +90,8 @@
#define CA15_DVFS 0
#define CA7_DVFS 1
#define SPC_SYS_CFG 2
-#define STAT_COMPLETE(type) ((1 << 0) << (type << 2))
-#define STAT_ERR(type) ((1 << 1) << (type << 2))
+#define STAT_COMPLETE(type) (BIT(0) << (type << 2))
+#define STAT_ERR(type) (BIT(1) << (type << 2))
#define RESPONSE_MASK(type) (STAT_COMPLETE(type) | STAT_ERR(type))

struct ve_spc_opp {
@@ -162,7 +162,7 @@ void ve_spc_cpu_wakeup_irq(u32 cluster, u32 cpu, bool set)
if (cluster >= MAX_CLUSTERS)
return;

- mask = 1 << cpu;
+ mask = BIT(cpu);

if (!cluster_is_a15(cluster))
mask <<= 4;
--
2.11.0
\
 
 \ /
  Last update: 2019-06-24 15:54    [W:0.174 / U:3.136 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site