Lines Matching defs:index
19 * array_index_mask_nospec() - generate a ~0 mask when index < size, 0 otherwise
20 * @index: array element index
23 * When @index is out of bounds (@index >= @size), the sign bit will be
25 * zero for an out of bounds index, or ~0 if within bounds [0, @size).
28 static inline unsigned long array_index_mask_nospec(unsigned long index,
34 * into account the value of @index under speculation.
36 OPTIMIZER_HIDE_VAR(index);
37 return ~(long)(index | (size - 1UL - index)) >> (BITS_PER_LONG - 1);
42 * array_index_nospec - sanitize an array index after a bounds check
46 * if (index < size) {
47 * index = array_index_nospec(index, size);
48 * val = array[index];
52 * array_index_nospec() will clamp the index within the range of [0,
55 #define array_index_nospec(index, size) \
57 typeof(index) _i = (index); \