Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a7ea4f03 authored by Isaac J. Manjarres's avatar Isaac J. Manjarres
Browse files

lib: ubsan: Fix compilation issues for ubsan



Currently, multiple declarations of data structures and
functions exist, as well as dead code that was meant to be
removed earlier. Remove dead code and multiple declarations
for ubsan.

Change-Id: I2b1d27ab2edc9852a3cd286c70fe8990aa0e0754
Signed-off-by: default avatarIsaac J. Manjarres <isaacm@codeaurora.org>
parent b2bdf7dc
Loading
Loading
Loading
Loading
+0 −28
Original line number Diff line number Diff line
@@ -351,34 +351,6 @@ void __ubsan_handle_type_mismatch_v1(struct type_mismatch_data_v1 *data,
}
EXPORT_SYMBOL(__ubsan_handle_type_mismatch_v1);

void __ubsan_handle_nonnull_return(struct nonnull_return_data *data)
{
	struct type_mismatch_data_common common_data = {
		.location = &data->location,
		.type = data->type,
		.alignment = data->alignment,
		.type_check_kind = data->type_check_kind
	};

	ubsan_type_mismatch_common(&common_data, ptr);
}
EXPORT_SYMBOL(__ubsan_handle_nonnull_return);

void __ubsan_handle_type_mismatch_v1(struct type_mismatch_data_v1 *data,
				unsigned long ptr)
{

	struct type_mismatch_data_common common_data = {
		.location = &data->location,
		.type = data->type,
		.alignment = 1UL << data->log_alignment,
		.type_check_kind = data->type_check_kind
	};

	ubsan_type_mismatch_common(&common_data, ptr);
}
EXPORT_SYMBOL(__ubsan_handle_type_mismatch_v1);

void __ubsan_handle_vla_bound_not_positive(struct vla_bound_data *data,
					unsigned long bound)
{
+0 −7
Original line number Diff line number Diff line
@@ -44,13 +44,6 @@ struct type_mismatch_data_v1 {
	unsigned char type_check_kind;
};

struct type_mismatch_data_common {
	struct source_location *location;
	struct type_descriptor *type;
	unsigned long alignment;
	unsigned char type_check_kind;
};

struct nonnull_arg_data {
	struct source_location location;
	struct type_descriptor *type;