]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commitdiff
symbols: sanitize a few variable's types
authorJan Beulich <jbeulich@suse.com>
Tue, 18 Mar 2025 08:46:38 +0000 (09:46 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 18 Mar 2025 08:46:38 +0000 (09:46 +0100)
Parameter and return types of symbols_expand_symbol() make clear that
xensyms_read()'s next_offset doesn't need to be 64-bit.

xensyms_read()'s first parameter type makes clear that the function's
next_symbols doesn't need to be 64-bit.

symbols_num_syms'es type makes clear that iteration locals in
symbols_lookup() don't need to be unsigned long (i.e. 64-bit on 64-bit
architectures).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/common/symbols.c

index 133b580768231eb00b5e03aa5516b87dfd1c306b..f8a7bde37b37bfb0099b0926b0a5d0d926de9e6e 100644 (file)
@@ -108,7 +108,7 @@ const char *symbols_lookup(unsigned long addr,
                            unsigned long *offset,
                            char *namebuf)
 {
-    unsigned long i, low, high, mid;
+    unsigned int i, low, high, mid;
     unsigned long symbol_end = 0;
     const struct virtual_region *region;
 
@@ -179,7 +179,7 @@ int xensyms_read(uint32_t *symnum, char *type,
      * from previous read. This can help us avoid the extra call to
      * get_symbol_offset().
      */
-    static uint64_t next_symbol, next_offset;
+    static unsigned int next_symbol, next_offset;
     static DEFINE_SPINLOCK(symbols_mutex);
 
     if ( *symnum > symbols_num_syms )