qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: "Gabriel L. Somlo" <gsomlo@gmail.com>
Cc: pbonzini@redhat.com, lersek@redhat.com, qemu-devel@nongnu.org,
	kraxel@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3 3/3] SMBIOS: Fix type 17 v2.7+ field sizes
Date: Mon, 19 May 2014 13:54:57 +0300	[thread overview]
Message-ID: <20140519105457.GD29674@redhat.com> (raw)
In-Reply-To: <1400015769-717-4-git-send-email-somlo@cmu.edu>

On Tue, May 13, 2014 at 05:16:09PM -0400, Gabriel L. Somlo wrote:
> Fields for configured_clock_speed and various voltage values
> introduced in v2.7 and v2.8 should be "word", i.e. 16 bits.
> 
> Reported-by: Laszlo Ersek <lersek@redhat.com>
> Signed-off-by: Gabriel Somlo <somlo@cmu.edu>

0 is 0 whatever you do with it.
But you wrote it, so if you prefer
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>


> ---
>  hw/i386/smbios.c         | 8 ++++----
>  include/hw/i386/smbios.h | 8 ++++----
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/hw/i386/smbios.c b/hw/i386/smbios.c
> index 1793821..b3bedde 100644
> --- a/hw/i386/smbios.c
> +++ b/hw/i386/smbios.c
> @@ -683,10 +683,10 @@ static void smbios_build_type_17_table(unsigned instance, ram_addr_t size)
>      SMBIOS_TABLE_SET_STR(17, asset_tag_number_str, type17.asset);
>      SMBIOS_TABLE_SET_STR(17, part_number_str, type17.part);
>      t->attributes = 0; /* Unknown */
> -    t->configured_clock_speed = cpu_to_le32(0); /* Unknown */
> -    t->minimum_voltage = cpu_to_le32(0); /* Unknown */
> -    t->maximum_voltage = cpu_to_le32(0); /* Unknown */
> -    t->configured_voltage = cpu_to_le32(0); /* Unknown */
> +    t->configured_clock_speed = cpu_to_le16(0); /* Unknown */
> +    t->minimum_voltage = cpu_to_le16(0); /* Unknown */
> +    t->maximum_voltage = cpu_to_le16(0); /* Unknown */
> +    t->configured_voltage = cpu_to_le16(0); /* Unknown */
>  
>      SMBIOS_BUILD_TABLE_POST;
>  }
> diff --git a/include/hw/i386/smbios.h b/include/hw/i386/smbios.h
> index 5583f60..a3f4d88 100644
> --- a/include/hw/i386/smbios.h
> +++ b/include/hw/i386/smbios.h
> @@ -182,10 +182,10 @@ struct smbios_type_17 {
>      uint8_t part_number_str;
>      uint8_t attributes;
>      uint32_t extended_size;
> -    uint32_t configured_clock_speed;
> -    uint32_t minimum_voltage;
> -    uint32_t maximum_voltage;
> -    uint32_t configured_voltage;
> +    uint16_t configured_clock_speed;
> +    uint16_t minimum_voltage;
> +    uint16_t maximum_voltage;
> +    uint16_t configured_voltage;
>  } QEMU_PACKED;
>  
>  /* SMBIOS type 19 - Memory Array Mapped Address (v2.7) */
> -- 
> 1.9.0
> 

  reply	other threads:[~2014-05-19 11:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-13 21:16 [Qemu-devel] [PATCH v3 0/3] SMBIOS cleanup round Gabriel L. Somlo
2014-05-13 21:16 ` [Qemu-devel] [PATCH v3 1/3] SMBIOS: Fix endian-ness when populating fields wider than 8-bit Gabriel L. Somlo
2014-05-19 10:53   ` Michael S. Tsirkin
2014-05-13 21:16 ` [Qemu-devel] [PATCH v3 2/3] SMBIOS: Update Type 0 struct generator for machines >= 2.1 Gabriel L. Somlo
2014-05-19 10:54   ` Michael S. Tsirkin
2014-05-13 21:16 ` [Qemu-devel] [PATCH v3 3/3] SMBIOS: Fix type 17 v2.7+ field sizes Gabriel L. Somlo
2014-05-19 10:54   ` Michael S. Tsirkin [this message]
2014-05-14 13:26 ` [Qemu-devel] [PATCH v3 0/3] SMBIOS cleanup round Laszlo Ersek
2014-05-19 10:53 ` 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=20140519105457.GD29674@redhat.com \
    --to=mst@redhat.com \
    --cc=gsomlo@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=lersek@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).