diff mbox series

[v5,12/23] hw/smbios: Remove 'smbios_uuid_encoded', simplify smbios_encode_uuid()

Message ID 20240529051539.71210-13-philmd@linaro.org
State Superseded
Headers show
Series hw/i386: Remove deprecated pc-i440fx-2.0 -> 2.3 machines | expand

Commit Message

Philippe Mathieu-Daudé May 29, 2024, 5:15 a.m. UTC
'smbios_encode_uuid' is always true, remove it,
simplifying smbios_encode_uuid().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
---
 hw/smbios/smbios.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

Comments

Igor Mammedov May 29, 2024, 2:26 p.m. UTC | #1
On Wed, 29 May 2024 07:15:28 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:

> 'smbios_encode_uuid' is always true, remove it,
> simplifying smbios_encode_uuid().
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Zhao Liu <zhao1.liu@intel.com>

I'd squash this into previous commit, but won't insist.

Reviewed-by: Igor Mammedov <imammedo@redhat.com>


> ---
>  hw/smbios/smbios.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
> index 8261eb716f..3b7703489d 100644
> --- a/hw/smbios/smbios.c
> +++ b/hw/smbios/smbios.c
> @@ -30,7 +30,6 @@
>  #include "hw/pci/pci_device.h"
>  #include "smbios_build.h"
>  
> -static const bool smbios_uuid_encoded = true;
>  /*
>   * SMBIOS tables provided by user with '-smbios file=<foo>' option
>   */
> @@ -600,11 +599,9 @@ static void smbios_build_type_0_table(void)
>  static void smbios_encode_uuid(struct smbios_uuid *uuid, QemuUUID *in)
>  {
>      memcpy(uuid, in, 16);
> -    if (smbios_uuid_encoded) {
> -        uuid->time_low = bswap32(uuid->time_low);
> -        uuid->time_mid = bswap16(uuid->time_mid);
> -        uuid->time_hi_and_version = bswap16(uuid->time_hi_and_version);
> -    }
> +    uuid->time_low = bswap32(uuid->time_low);
> +    uuid->time_mid = bswap16(uuid->time_mid);
> +    uuid->time_hi_and_version = bswap16(uuid->time_hi_and_version);
>  }
>  
>  static void smbios_build_type_1_table(void)
diff mbox series

Patch

diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
index 8261eb716f..3b7703489d 100644
--- a/hw/smbios/smbios.c
+++ b/hw/smbios/smbios.c
@@ -30,7 +30,6 @@ 
 #include "hw/pci/pci_device.h"
 #include "smbios_build.h"
 
-static const bool smbios_uuid_encoded = true;
 /*
  * SMBIOS tables provided by user with '-smbios file=<foo>' option
  */
@@ -600,11 +599,9 @@  static void smbios_build_type_0_table(void)
 static void smbios_encode_uuid(struct smbios_uuid *uuid, QemuUUID *in)
 {
     memcpy(uuid, in, 16);
-    if (smbios_uuid_encoded) {
-        uuid->time_low = bswap32(uuid->time_low);
-        uuid->time_mid = bswap16(uuid->time_mid);
-        uuid->time_hi_and_version = bswap16(uuid->time_hi_and_version);
-    }
+    uuid->time_low = bswap32(uuid->time_low);
+    uuid->time_mid = bswap16(uuid->time_mid);
+    uuid->time_hi_and_version = bswap16(uuid->time_hi_and_version);
 }
 
 static void smbios_build_type_1_table(void)