ubsan: fix undefined shifts
A signed integer cannot be shifted in a way that will flip the sign bit; make such arguments unsigned to be safe Change-Id: Iafc060f98f899ae3ffb876ba22fdd6183fbb6e57
This commit is contained in:
@ -60,9 +60,9 @@
|
||||
|
||||
#ifdef CONFIG_HAS_NMI
|
||||
#define GICD_INT_NMI_PRI 0x40
|
||||
#define GICD_INT_DEF_PRI 0xc0
|
||||
#define GICD_INT_DEF_PRI 0xc0U
|
||||
#else
|
||||
#define GICD_INT_DEF_PRI 0xa0
|
||||
#define GICD_INT_DEF_PRI 0xa0U
|
||||
#endif
|
||||
#define GICD_INT_DEF_PRI_X4 ((GICD_INT_DEF_PRI << 24) |\
|
||||
(GICD_INT_DEF_PRI << 16) |\
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
(((midr) & MIDR_VARIANT_MASK) >> MIDR_VARIANT_SHIFT)
|
||||
|
||||
#define MIDR_IMPLEMENTOR_SHIFT 24
|
||||
#define MIDR_IMPLEMENTOR_MASK (0xff << MIDR_IMPLEMENTOR_SHIFT)
|
||||
#define MIDR_IMPLEMENTOR_MASK (0xffU << MIDR_IMPLEMENTOR_SHIFT)
|
||||
#define MIDR_IMPLEMENTOR(midr) \
|
||||
(((midr) & MIDR_IMPLEMENTOR_MASK) >> MIDR_IMPLEMENTOR_SHIFT)
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
#ifndef INCLUDE_BITOPS_FLS_H
|
||||
#define INCLUDE_BITOPS_FLS_H
|
||||
|
||||
static inline int fls(int x)
|
||||
static inline int fls(unsigned int x)
|
||||
{
|
||||
int r = 32;
|
||||
if (!x) {
|
||||
|
||||
Reference in New Issue
Block a user