lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 23 Jun 2019 22:13:10 +0700
From:   Phong Tran <tranmanphong@...il.com>
To:     mark.rutland@....com, kstewart@...uxfoundation.org,
        songliubraving@...com, andrew@...n.ch, peterz@...radead.org,
        nsekhar@...com, ast@...nel.org, jolsa@...hat.com,
        netdev@...r.kernel.org, gerg@...inux.org,
        lorenzo.pieralisi@....com, will@...nel.org,
        linux-samsung-soc@...r.kernel.org, daniel@...earbox.net,
        tranmanphong@...il.com, festevam@...il.com,
        gregory.clement@...tlin.com, allison@...utok.net,
        linux@...linux.org.uk, krzk@...nel.org, haojian.zhuang@...il.com,
        bgolaszewski@...libre.com, tony@...mide.com, mingo@...hat.com,
        linux-imx@....com, yhs@...com, sebastian.hesselbarth@...il.com,
        illusionist.neo@...il.com, jason@...edaemon.net,
        liviu.dudau@....com, s.hauer@...gutronix.de, acme@...nel.org,
        lkundrak@...sk, robert.jarzmik@...e.fr, dmg@...ingmachine.org,
        swinslow@...il.com, namhyung@...nel.org, tglx@...utronix.de,
        linux-omap@...r.kernel.org, alexander.sverdlin@...il.com,
        linux-arm-kernel@...ts.infradead.org, info@...ux.net,
        gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org,
        alexander.shishkin@...ux.intel.com, hsweeten@...ionengravers.com,
        kgene@...nel.org, kernel@...gutronix.de, sudeep.holla@....com,
        bpf@...r.kernel.org, shawnguo@...nel.org, kafai@...com,
        daniel@...que.org
Subject: [PATCH 12/15] ARM: vexpress: cleanup cppcheck shifting error

[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@...il.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..f8911dae776c 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)	(1U << (cpu))
+#define STANDBYWFI_STAT_A7_CPU_MASK(cpu)	(1U << (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		(1U << 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)	((1U << 0) << (type << 2))
+#define STAT_ERR(type)		((1U << 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 = 1U << cpu;
 
 	if (!cluster_is_a15(cluster))
 		mask <<= 4;
-- 
2.11.0

Powered by blists - more mailing lists