[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 01/32] cpuid: use unsigned for max cpuid
From: |
Michael S. Tsirkin |
Subject: |
[PULL 01/32] cpuid: use unsigned for max cpuid |
Date: |
Fri, 4 Feb 2022 20:42:39 -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 | 2 +-
util/bufferiszero.c | 2 +-
tcg/i386/tcg-target.c.inc | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/configure b/configure
index e6cfc0e4be..dfb9019b24 100755
--- 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);
diff --git a/util/bufferiszero.c b/util/bufferiszero.c
index 695bb4ce28..ec3cd4ca15 100644
--- a/util/bufferiszero.c
+++ b/util/bufferiszero.c
@@ -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;
diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc
index 875311f795..4dab09f265 100644
--- a/tcg/i386/tcg-target.c.inc
+++ b/tcg/i386/tcg-target.c.inc
@@ -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. */
--
MST
- [PULL 00/32] virtio,pc: features, cleanups, fixes, Michael S. Tsirkin, 2022/02/04
- [PULL 01/32] cpuid: use unsigned for max cpuid,
Michael S. Tsirkin <=
- [PULL 02/32] hw/i386: Add the possibility to disable the 'isapc' machine, Michael S. Tsirkin, 2022/02/04
- [PULL 03/32] tests: acpi: manually pad OEM_ID/OEM_TABLE_ID for test_oem_fields() test, Michael S. Tsirkin, 2022/02/04
- [PULL 04/32] tests: acpi: whitelist nvdimm's SSDT and FACP.slic expected blobs, Michael S. Tsirkin, 2022/02/04
- [PULL 05/32] acpi: fix OEM ID/OEM Table ID padding, Michael S. Tsirkin, 2022/02/04
- [PULL 07/32] tests: acpi: test short OEM_ID/OEM_TABLE_ID values in test_oem_fields(), Michael S. Tsirkin, 2022/02/04
- [PULL 10/32] libvhost-user: Simplify VHOST_USER_REM_MEM_REG, Michael S. Tsirkin, 2022/02/04
- [PULL 14/32] libvhost-user: Map shared RAM with MAP_NORESERVE to support virtio-mem with hugetlb, Michael S. Tsirkin, 2022/02/04
- [PULL 12/32] libvhost-user: prevent over-running max RAM slots, Michael S. Tsirkin, 2022/02/04
- [PULL 09/32] libvhost-user: Add vu_add_mem_reg input validation, Michael S. Tsirkin, 2022/02/04
- [PULL 13/32] libvhost-user: handle removal of identical regions, Michael S. Tsirkin, 2022/02/04