[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] ubsan: use linux-compat.h



commit b64f62fcbde3cf050056cffa81c7e7b9ed053f94
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Mon Sep 23 16:31:49 2024 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Sep 23 16:31:49 2024 +0200

    ubsan: use linux-compat.h
    
    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@xxxxxxxxxx>
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/common/ubsan/ubsan.c | 7 +++----
 xen/common/ubsan/ubsan.h | 2 ++
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/common/ubsan/ubsan.c b/xen/common/ubsan/ubsan.c
index 5d50c10742..7f73f94759 100644
--- a/xen/common/ubsan/ubsan.c
+++ b/xen/common/ubsan/ubsan.c
@@ -20,8 +20,6 @@ static DEFINE_PER_CPU(struct xen_ubsan[1], in_ubsan);
 #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, size_t size, struct 
type_descriptor *type,
 #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));
                }
        }
 }
diff --git a/xen/common/ubsan/ubsan.h b/xen/common/ubsan/ubsan.h
index 3db42e75b1..9c7f3b9b6c 100644
--- 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,
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.