]> xenbits.xensource.com Git - xen.git/commitdiff
kexec: fix some types
authorJan Beulich <jbeulich@suse.com>
Mon, 19 Jan 2015 11:01:18 +0000 (12:01 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 19 Jan 2015 11:01:18 +0000 (12:01 +0100)
crashinfo_maxaddr can/will be a 64-bit type, hence passing it to fls()
is wrong.

crashinfo_maxaddr_bits, otoh, doesn't need to be a paddr_t, and can
additionally be __initdata.

struct xen_kexec_reserve's start field - representing a physical
address - ought to have respective type.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
xen/common/kexec.c
xen/include/asm-x86/bitops.h
xen/include/xen/kexec.h

index 2239ee8df3e16f55309031a5d4c3f224c0f3d22d..c579ac824c1ccec0c89a88d91a0a78751442920e 100644 (file)
@@ -78,7 +78,7 @@ static paddr_t __initdata crashinfo_maxaddr = 4ULL << 30;
 
 /* = log base 2 of crashinfo_maxaddr after checking for sanity. Default to
  * larger than the entire physical address space. */
-paddr_t crashinfo_maxaddr_bits = 64;
+unsigned int __initdata crashinfo_maxaddr_bits = 64;
 
 /* Pointers to keep track of the crash heap region. */
 static void *crash_heap_current = NULL, *crash_heap_end = NULL;
@@ -532,7 +532,7 @@ void __init kexec_early_calculations(void)
         low_crashinfo_mode = LOW_CRASHINFO_NONE;
 
     if ( low_crashinfo_mode > LOW_CRASHINFO_NONE )
-        crashinfo_maxaddr_bits = fls(crashinfo_maxaddr) - 1;
+        crashinfo_maxaddr_bits = fls64(crashinfo_maxaddr) - 1;
 }
 
 static int __init kexec_init(void)
index 82a08eec40ae17c7e970c4db9052ecb488276ba9..3e9ca005c62f8798674989bcd6bd4f6f28107f88 100644 (file)
@@ -429,6 +429,9 @@ static inline int fls(unsigned long x)
     return (int)r+1;
 }
 
+#define ffs64 ffs
+#define fls64 fls
+
 /**
  * hweightN - returns the hamming weight of a N-bit word
  * @x: the word to weigh
index bd177477a3c61fe4b9ba225eda5a0c64d8b4c5bb..b7d121d06423142684ba585e7d14887d75fbfdad 100644 (file)
@@ -10,7 +10,7 @@
 
 typedef struct xen_kexec_reserve {
     unsigned long size;
-    unsigned long start;
+    paddr_t start;
 } xen_kexec_reserve_t;
 
 extern xen_kexec_reserve_t kexec_crash_area;
@@ -38,7 +38,7 @@ enum low_crashinfo {
 /* Low crashinfo mode.  Start as INVALID so serveral codepaths can set up
  * defaults without needing to know the state of the others. */
 extern enum low_crashinfo low_crashinfo_mode;
-extern paddr_t crashinfo_maxaddr_bits;
+extern unsigned int crashinfo_maxaddr_bits;
 void kexec_early_calculations(void);
 
 int machine_kexec_add_page(struct kexec_image *image, unsigned long vaddr,