diff mbox series

[v2,1/2] ubsan: use linux-compat.h

Message ID a3cbf638-5a16-4813-9606-fb0c37075b3c@suse.com (mailing list archive)
State New
Headers show
Series types: (mostly) purge Linux-inherited s64 | expand

Commit Message

Jan Beulich Sept. 12, 2024, 12:19 p.m. UTC
Instead of replacing the s64 (and later also u64) uses, keep the file as
little modified as possible from its Linux origin. (Sadly the two cast
adjustments are needed to avoid compiler warnings.)

Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v2: New.

Comments

Andrew Cooper Sept. 12, 2024, 12:53 p.m. UTC | #1
On 12/09/2024 1:19 pm, Jan Beulich wrote:
> Instead of replacing the s64 (and later also u64) uses, keep the file as
> little modified as possible from its Linux origin. (Sadly the two cast
> adjustments are needed to avoid compiler warnings.)
>
> Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
diff mbox series

Patch

--- a/xen/common/ubsan/ubsan.c
+++ b/xen/common/ubsan/ubsan.c
@@ -20,8 +20,6 @@  static DEFINE_PER_CPU(struct xen_ubsan[1
 #undef current
 #define current this_cpu(in_ubsan)
 #define dump_stack dump_execution_state
-#define u64 long long unsigned int
-#define s64 long long int
 
 #include "ubsan.h"
 
@@ -141,10 +139,11 @@  static void val_to_string(char *str, siz
 #endif
 		} else if (type_is_signed(type)) {
 			scnprintf(str, size, "%lld",
-				(s64)get_signed_val(type, value));
+				  (long long)get_signed_val(type, value));
 		} else {
 			scnprintf(str, size, "%llu",
-				(u64)get_unsigned_val(type, value));
+				  (unsigned long long)get_unsigned_val(type,
+								       value));
 		}
 	}
 }
--- a/xen/common/ubsan/ubsan.h
+++ b/xen/common/ubsan/ubsan.h
@@ -1,6 +1,8 @@ 
 #ifndef _LIB_UBSAN_H
 #define _LIB_UBSAN_H
 
+#include <xen/linux-compat.h>
+
 enum {
 	type_kind_int = 0,
 	type_kind_float = 1,