linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] include/linux/arm-smccc.h: avoid sign extension problem
@ 2016-06-01 12:49 Jens Wiklander
  2016-06-01 16:04 ` Russell King - ARM Linux
  0 siblings, 1 reply; 3+ messages in thread
From: Jens Wiklander @ 2016-06-01 12:49 UTC (permalink / raw)
  To: linux-arm-kernel

Prior to this patch the ARM_SMCCC_FAST_CALL constant was of a signed
type causing unwanted sign extension. This patch explicitly selects an
unsigned type for the constant.

Reported-by: Saksham Jain <sakjain92@gmail.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 include/linux/arm-smccc.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h
index b5abfda..699c0d8 100644
--- a/include/linux/arm-smccc.h
+++ b/include/linux/arm-smccc.h
@@ -23,8 +23,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
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-02  8:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-01 12:49 [PATCH] include/linux/arm-smccc.h: avoid sign extension problem Jens Wiklander
2016-06-01 16:04 ` Russell King - ARM Linux
2016-06-02  8:28   ` Jens Wiklander

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).