Lines Matching refs:type

120 static bool type_is_int(struct type_descriptor *type)  in type_is_int()  argument
122 return type->type_kind == type_kind_int; in type_is_int()
125 static bool type_is_signed(struct type_descriptor *type) in type_is_signed() argument
127 WARN_ON(!type_is_int(type)); in type_is_signed()
128 return type->type_info & 1; in type_is_signed()
131 static unsigned type_bit_width(struct type_descriptor *type) in type_bit_width() argument
133 return 1 << (type->type_info >> 1); in type_bit_width()
136 static bool is_inline_int(struct type_descriptor *type) in is_inline_int() argument
139 unsigned bits = type_bit_width(type); in is_inline_int()
141 WARN_ON(!type_is_int(type)); in is_inline_int()
146 static s_max get_signed_val(struct type_descriptor *type, void *val) in get_signed_val() argument
148 if (is_inline_int(type)) { in get_signed_val()
149 unsigned extra_bits = sizeof(s_max)*8 - type_bit_width(type); in get_signed_val()
155 if (type_bit_width(type) == 64) in get_signed_val()
161 static bool val_is_negative(struct type_descriptor *type, void *val) in val_is_negative() argument
163 return type_is_signed(type) && get_signed_val(type, val) < 0; in val_is_negative()
166 static u_max get_unsigned_val(struct type_descriptor *type, void *val) in get_unsigned_val() argument
168 if (is_inline_int(type)) in get_unsigned_val()
171 if (type_bit_width(type) == 64) in get_unsigned_val()
177 static void val_to_string(char *str, size_t size, struct type_descriptor *type, in val_to_string() argument
180 if (type_is_int(type)) { in val_to_string()
181 if (type_bit_width(type) == 128) { in val_to_string()
183 u_max val = get_unsigned_val(type, value); in val_to_string()
193 } else if (type_is_signed(type)) { in val_to_string()
195 (s64)get_signed_val(type, value)); in val_to_string()
198 (u64)get_unsigned_val(type, value)); in val_to_string()
236 val_to_string(rhs_val_str, sizeof(rhs_val_str), data->type, rhs); in __ubsan_handle_divrem_overflow()
238 if (type_is_signed(data->type) && get_signed_val(data->type, rhs) == -1) in __ubsan_handle_divrem_overflow()
240 rhs_val_str, data->type->type_name); in __ubsan_handle_divrem_overflow()
257 data->type->type_name); in handle_null_ptr_deref()
272 (void *)ptr, data->type->type_name); in handle_misaligned_access()
288 pr_err("for an object of type %s\n", data->type->type_name); in handle_object_size_mismatch()
312 .type = data->type, in __ubsan_handle_type_mismatch()
326 .type = data->type, in __ubsan_handle_type_mismatch_v1()
415 val_to_string(val_str, sizeof(val_str), data->type, val); in __ubsan_handle_load_invalid_value()
418 val_str, data->type->type_name); in __ubsan_handle_load_invalid_value()
440 align, offset, data->type->type_name); in __ubsan_handle_alignment_assumption()
443 align, data->type->type_name); in __ubsan_handle_alignment_assumption()