]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
cpuid: use unsigned for max cpuid
authorMichael S. Tsirkin <mst@redhat.com>
Tue, 25 Jan 2022 19:17:33 +0000 (14:17 -0500)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 4 Feb 2022 14:07:43 +0000 (09:07 -0500)
__get_cpuid_max returns an unsigned value.
For consistency, store the result in an unsigned variable.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
configure
tcg/i386/tcg-target.c.inc
util/bufferiszero.c

index e6cfc0e4be6cf2da7a6d107ab1f33be0764e48d6..dfb9019b24f27bd801b6001568d23a1fcda687ef 100755 (executable)
--- a/configure
+++ b/configure
@@ -2768,7 +2768,7 @@ cat > $TMPC << EOF
 #include <cpuid.h>
 int main(void) {
     unsigned a, b, c, d;
-    int max = __get_cpuid_max(0, 0);
+    unsigned max = __get_cpuid_max(0, 0);
 
     if (max >= 1) {
         __cpuid(1, a, b, c, d);
index 875311f795f9c882b68131fc7a12604b734041fb..4dab09f265accbf4dd70aa859fb1c341272c107a 100644 (file)
@@ -3747,7 +3747,7 @@ static void tcg_target_init(TCGContext *s)
 {
 #ifdef CONFIG_CPUID_H
     unsigned a, b, c, d, b7 = 0;
-    int max = __get_cpuid_max(0, 0);
+    unsigned max = __get_cpuid_max(0, 0);
 
     if (max >= 7) {
         /* BMI1 is available on AMD Piledriver and Intel Haswell CPUs.  */
index 695bb4ce28b6ff9b85804e32cac023a350d48143..ec3cd4ca154e4ca134b67887c39a56fbfaace898 100644 (file)
@@ -272,7 +272,7 @@ static void init_accel(unsigned cache)
 
 static void __attribute__((constructor)) init_cpuid_cache(void)
 {
-    int max = __get_cpuid_max(0, NULL);
+    unsigned max = __get_cpuid_max(0, NULL);
     int a, b, c, d;
     unsigned cache = 0;