All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Richard Henderson" <rth@twiddle.net>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>
Subject: [PULL 01/32] cpuid: use unsigned for max cpuid
Date: Fri, 4 Feb 2022 20:42:39 -0500	[thread overview]
Message-ID: <20220205014149.1189026-2-mst@redhat.com> (raw)
In-Reply-To: <20220205014149.1189026-1-mst@redhat.com>

__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



  reply	other threads:[~2022-02-05  1:54 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-05  1:42 [PULL 00/32] virtio,pc: features, cleanups, fixes Michael S. Tsirkin
2022-02-05  1:42 ` Michael S. Tsirkin [this message]
2022-02-05  1:42 ` [PULL 02/32] hw/i386: Add the possibility to disable the 'isapc' machine Michael S. Tsirkin
2022-02-05  1:42 ` [PULL 03/32] tests: acpi: manually pad OEM_ID/OEM_TABLE_ID for test_oem_fields() test Michael S. Tsirkin
2022-02-05  1:42 ` [PULL 04/32] tests: acpi: whitelist nvdimm's SSDT and FACP.slic expected blobs Michael S. Tsirkin
2022-02-05  1:42 ` [PULL 05/32] acpi: fix OEM ID/OEM Table ID padding Michael S. Tsirkin
2022-02-05  1:42 ` [PULL 06/32] tests: acpi: update expected blobs Michael S. Tsirkin
2022-02-05  1:42 ` [PULL 07/32] tests: acpi: test short OEM_ID/OEM_TABLE_ID values in test_oem_fields() Michael S. Tsirkin
2022-02-05  1:42 ` [PULL 08/32] libvhost-user: Add vu_rem_mem_reg input validation Michael S. Tsirkin
2022-02-05  1:42 ` [PULL 09/32] libvhost-user: Add vu_add_mem_reg " Michael S. Tsirkin
2022-02-05  1:43 ` [PULL 10/32] libvhost-user: Simplify VHOST_USER_REM_MEM_REG Michael S. Tsirkin
2022-02-05  1:43 ` [PULL 11/32] libvhost-user: fix VHOST_USER_REM_MEM_REG not closing the fd Michael S. Tsirkin
2022-02-05  1:43 ` [PULL 12/32] libvhost-user: prevent over-running max RAM slots Michael S. Tsirkin
2022-02-05  1:43 ` [PULL 13/32] libvhost-user: handle removal of identical regions Michael S. Tsirkin
2022-02-05  1:43 ` [PULL 14/32] libvhost-user: Map shared RAM with MAP_NORESERVE to support virtio-mem with hugetlb Michael S. Tsirkin
2022-02-05  1:43 ` [Virtio-fs] [PULL 15/32] virtio: drop name parameter for virtio_init() Michael S. Tsirkin
2022-02-05  1:43   ` Michael S. Tsirkin
2022-02-05  1:43 ` [Virtio-fs] [PULL 16/32] virtio: add vhost support for virtio devices Michael S. Tsirkin
2022-02-05  1:43   ` Michael S. Tsirkin
2022-02-05  1:43 ` [PULL 18/32] qmp: add QMP command x-query-virtio-status Michael S. Tsirkin
2022-02-05  1:45   ` Michael S. Tsirkin
2022-02-05  1:43 ` [Virtio-fs] [PULL 19/32] qmp: decode feature & status bits in virtio-status Michael S. Tsirkin
2022-02-05  1:43   ` Michael S. Tsirkin
2022-02-05  1:43 ` [PULL 21/32] qmp: add QMP command x-query-virtio-queue-element Michael S. Tsirkin
2022-02-05  1:43   ` Michael S. Tsirkin
2022-02-05  1:45     ` Michael S. Tsirkin
2022-02-05  1:43 ` [PULL 22/32] hmp: add virtio commands Michael S. Tsirkin
2022-02-05  1:43 ` [PULL 23/32] ACPI ERST: bios-tables-test.c steps 1 and 2 Michael S. Tsirkin
2022-02-05  1:43 ` [PULL 24/32] ACPI ERST: PCI device_id for ERST Michael S. Tsirkin
2022-02-05  1:43 ` [PULL 25/32] ACPI ERST: header file " Michael S. Tsirkin
2022-02-05  1:43 ` [PULL 26/32] ACPI ERST: support for ACPI ERST feature Michael S. Tsirkin
2022-02-05  1:43 ` [PULL 27/32] ACPI ERST: build the ACPI ERST table Michael S. Tsirkin
2022-02-05  1:43 ` [PULL 28/32] ACPI ERST: create ACPI ERST table for pc/x86 machines Michael S. Tsirkin
2022-02-05  1:43 ` [PULL 29/32] ACPI ERST: qtest for ERST Michael S. Tsirkin
2022-02-05  1:44 ` [PULL 30/32] ACPI ERST: bios-tables-test testcase Michael S. Tsirkin
2022-02-05  1:44 ` [PULL 31/32] ACPI ERST: step 6 of bios-tables-test.c Michael S. Tsirkin
2022-02-05  1:44 ` [PULL 32/32] util/oslib-posix: Fix missing unlock in the error path of os_mem_prealloc() Michael S. Tsirkin
2022-02-05  1:44 ` [PULL 17/32] qmp: add QMP command x-query-virtio Michael S. Tsirkin
2022-02-05  1:44 ` [PULL 20/32] qmp: add QMP commands for virtio/vhost queue-status Michael S. Tsirkin
2022-02-05 11:07 ` [PULL 00/32] virtio,pc: features, cleanups, fixes Peter Maydell
2022-02-05 12:25   ` Michael S. Tsirkin
2022-02-05 13:31     ` Peter Maydell
2022-02-05 17:42       ` Michael S. Tsirkin
2022-02-05 21:05         ` Peter Maydell
2022-02-06  9:29           ` Michael S. Tsirkin
2022-02-06 10:44             ` Peter Maydell
2022-02-06 15:38               ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220205014149.1189026-2-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.