From patchwork Wed Mar 27 09:51:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 783117 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp2108250wrt; Wed, 27 Mar 2024 02:56:29 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXzHKdeYd/5rjCytk0X+DqLpGJOOWYuD+gYS6dfYJ+zJEKvErYAqOoyUgiTDZuCL0X/2912jNyr+cKmnwayEPu6 X-Google-Smtp-Source: AGHT+IFl47LEIkIb3WGZUEPTHF3YHeF1TMCOGTjvi1x6DlE0lnKWH+09OjaPEU74UYd+BPz9NmNw X-Received: by 2002:a0d:c746:0:b0:611:2aae:40f with SMTP id j67-20020a0dc746000000b006112aae040fmr478643ywd.0.1711533389580; Wed, 27 Mar 2024 02:56:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711533389; cv=none; d=google.com; s=arc-20160816; b=RdMPwMDCo7/0e6V7+jR3NOdH4k1bcMkvuB0EVpfFjfx2f6ACQXOZnroQiGSq3OPPSV PluW1WGERRPd349utzk7UFEbi6CgiqWRPNjdOJq/MtjdroJmfKblpTVnpGFufcbi031x L38H/jToQzuPtYo1p0wsjiE1GFNLGI1sUZOZWQ6V9HPoF4UZysNcycd6NHLZaxr+gBKI NIqRhqqHJFOVxHcj+LhAAnom1Oc4vGDIcewRTHAN+vj0LPzwNElPguyjA03paWz4oU/s HXjigdt0vB/HqggjXvc9MLcReVi4RhpoJ6Duhp8d7K1L7ujC0K9t7IIARG/+JQdu71Hx ro7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OsIizV2m9/3hMtPiDzFMJ5egzT3hkg2W7UMGOxAPpCY=; fh=i6gJH94/tScEf9GtbJboQdc+nTNdusa7/J/erPfrMAE=; b=tnrJXvHmzHHlMVUTIZTEMBJJxRmsqJqNIv8hAclxRDqpKPz4KEKHGP244fm00RWp3P 3hXHlyZAP+HJjyXfoPCkR6nB/syfbGpYAlMJ0vDaoyyJHE6cWoHNQb0q4WNhWYjooMOr rNnTuHKVvX64oNL7v1puE6di8ZrrY0+ukAumLoSxEhdZtizBRZsTDnJIUE0bgzEi0QTh UjxeMcJ5cuSHSYP5GQszxxPvU+6RmnubwMpabhoKCjLVPwyeNv1fRoeaTMPAgQguaPDm KwjzEXAmUZvXT7kD9IASRu41t9ohoiUgofaxnY4pteLPpyZg9YsdWP7ZhaHcPX/otFry eZlw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a0+aSuiq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h21-20020a37de15000000b0078a40127b4esi9321105qkj.33.2024.03.27.02.56.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Mar 2024 02:56:29 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a0+aSuiq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpPxX-0004Xf-FP; Wed, 27 Mar 2024 05:52:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpPxV-0004Jd-P4 for qemu-devel@nongnu.org; Wed, 27 Mar 2024 05:52:37 -0400 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rpPxU-0006oe-77 for qemu-devel@nongnu.org; Wed, 27 Mar 2024 05:52:37 -0400 Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-515a86daf09so4808043e87.3 for ; Wed, 27 Mar 2024 02:52:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711533154; x=1712137954; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OsIizV2m9/3hMtPiDzFMJ5egzT3hkg2W7UMGOxAPpCY=; b=a0+aSuiqnIhw/kQIpKKPglJ8y4hl6qpncGmMSU7PUni5TdKVb/FZCaNX0aBpOQyJ14 L89ZEwNV9BztbR9AkUBtOz3WKy5nmX1pHLps+nNSttdxV/aqDIu8LO0GGyNOn5JlZpL6 Hax5QgZDpbp+7gHtu3eA3QX0AePwi1HvRFHoT/IS/F82AMzJCIaoJEXXq9tCKqgiwWhU BvdLNYXdTLiOVh97cIT6rHUM/vZV0dYrAF4rGE2sBuiCltfcqtONGypCxuW8JKCEkxKe Ky+RdzsHAzRvk6WuhsBohv+E15ggrSyNHg0u0LDlDved+7kAAOkLfapc+sC+RD8ZO0q7 CDAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711533154; x=1712137954; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OsIizV2m9/3hMtPiDzFMJ5egzT3hkg2W7UMGOxAPpCY=; b=w2G2ea1SJwNdBbcVJY0UlRlBgDV1ypS5k5kti2JMLAbCrkRaE0vS9V/mrsz3l+v5oE ilK7GaFq6OLINW1ESpCd6ILdpphc5ytj0dssmUHn3CJJKQDi+p9EWgpW24zl+f8LIOER ppuggMp22HbcbSLGyDRpSAdK1oWAZWduyIiSHEwkBdsJX3Y+o+GyjINaKzw/3pTVINsY 3ZYLHEt1pxcKttBdBOsKjNIW1IYlSELKU9K2gov9DMwO+4ZtqoNlS1KU7kmfpd2V4V/h 6hoaU8txontAtBbG5Fd3ssUb8AQyqNoaxQBqPKquzpu8o5CnE1s6PjvOqY/lXK04TsBu VLtg== X-Forwarded-Encrypted: i=1; AJvYcCUWeMzEB+44ubqcF7993KAcofH7RzB9bCst0vwcUZpO9Wf7t/6f1DGMUF+CdGIkuB2i9iDufnuk2mIFECC7ldiRaehaiMQ= X-Gm-Message-State: AOJu0YxF+eGdyfUpUoeXyUXUEm8VO+GjK9EIbztR9q55PdhstOfBxXh4 bkJrJUyx1J7BrkOpYB/A+/JUZMFYw64/dRVGwI0ZoVdFs8PeLRWC49n8Kn7EsxM= X-Received: by 2002:ac2:5a5d:0:b0:515:8c3e:566b with SMTP id r29-20020ac25a5d000000b005158c3e566bmr582754lfn.31.1711533154397; Wed, 27 Mar 2024 02:52:34 -0700 (PDT) Received: from m1x-phil.lan ([176.187.205.175]) by smtp.gmail.com with ESMTPSA id i18-20020a170906265200b00a4df5e48d11sm1558656ejc.72.2024.03.27.02.52.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 27 Mar 2024 02:52:34 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , qemu-devel@nongnu.org, Igor Mammedov Cc: Paolo Bonzini , devel@lists.libvirt.org, Zhao Liu , Gerd Hoffmann , "Michael S. Tsirkin" , Ani Sinha , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.1 v2 11/21] hw/smbios: Remove 'smbios_uuid_encoded', simplify smbios_encode_uuid() Date: Wed, 27 Mar 2024 10:51:13 +0100 Message-ID: <20240327095124.73639-12-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240327095124.73639-1-philmd@linaro.org> References: <20240327095124.73639-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::135; envelope-from=philmd@linaro.org; helo=mail-lf1-x135.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 'smbios_encode_uuid' is always true, remove it, simplifying smbios_encode_uuid(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Zhao Liu --- 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=' 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)