Skip to content

Commit

Permalink
include/linux/arm-smccc.h: avoid sign extension problem
Browse files Browse the repository at this point in the history
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 <[email protected]>
Tested-by: Jens Wiklander <[email protected]> (QEMU Aarch64)
Reported-by: Saksham Jain <[email protected]>
Signed-off-by: Jens Wiklander <[email protected]>
  • Loading branch information
jenswi-linaro committed Jan 3, 2017
1 parent 05bf811 commit 253e930
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/linux/arm-smccc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 253e930

Please sign in to comment.