include/linux/arm-smccc.h: avoid sign extension problem
authorJens Wiklander <jens.wiklander@linaro.org>
Tue, 24 May 2016 11:16:44 +0000 (13:16 +0200)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:55:38 +0000 (15:55 -0500)
Prior to this patch the ARM_SMCCC_FAST_CALL constant was of an unsigned
type causing unwanted sign extension. This patch explicitly selects an
unsigned type for the constant.

Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU Aarch64)
Reported-by: Saksham Jain <sakjain92@gmail.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
From https://github.com/linaro-swg/linux.git
(cherry picked from commit 253e93086578d3f737cd16e79efb95cc6a833195)

include/linux/arm-smccc.h

index 4c5bca3..1b38b7b 100644 (file)
@@ -20,8 +20,9 @@
  * http://infocenter.arm.com/help/topic/com.arm.doc.den0028a/index.html
  */
 
-#define ARM_SMCCC_STD_CALL             0
-#define ARM_SMCCC_FAST_CALL            1
+/* This constant is shifted by 31, make sure it's of an unsigned type */
+#define ARM_SMCCC_STD_CALL             0UL
+#define ARM_SMCCC_FAST_CALL            1UL
 #define ARM_SMCCC_TYPE_SHIFT           31
 
 #define ARM_SMCCC_SMC_32               0