Lines Matching full:index
15 * array_index_mask_nospec() - generate a ~0 mask when index < size, 0 otherwise
16 * @index: array element index
19 * When @index is out of bounds (@index >= @size), the sign bit will be
21 * zero for an out of bounds index, or ~0 if within bounds [0, @size).
24 static inline unsigned long array_index_mask_nospec(unsigned long index, in array_index_mask_nospec() argument
30 * into account the value of @index under speculation. in array_index_mask_nospec()
32 OPTIMIZER_HIDE_VAR(index); in array_index_mask_nospec()
33 return ~(long)(index | (size - 1UL - index)) >> (BITS_PER_LONG - 1); in array_index_mask_nospec()
38 * array_index_nospec - sanitize an array index after a bounds check
42 * if (index < size) {
43 * index = array_index_nospec(index, size);
44 * val = array[index];
48 * array_index_nospec() will clamp the index within the range of [0,
51 #define array_index_nospec(index, size) \ argument
53 typeof(index) _i = (index); \