qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 04/15] acpi: drop pointless _STA method


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v3 04/15] acpi: drop pointless _STA method
Date: Thu, 30 Apr 2020 08:35:01 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

On 4/29/20 3:59 PM, Gerd Hoffmann wrote:
When returning a constant there is no point in having a method
in the first place, _STA can be a simple integer instead.

Signed-off-by: Gerd Hoffmann <address@hidden>
Reviewed-by: Igor Mammedov <address@hidden>

Reviewed-by: Philippe Mathieu-Daudé <address@hidden>

---
  hw/i386/acpi-build.c | 14 +++-----------
  1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 23c77eeb95a9..3a046b03e4cd 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1151,14 +1151,11 @@ static Aml *build_kbd_device_aml(void)
  {
      Aml *dev;
      Aml *crs;
-    Aml *method;
dev = aml_device("KBD");
      aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0303")));
- method = aml_method("_STA", 0, AML_NOTSERIALIZED);
-    aml_append(method, aml_return(aml_int(0x0f)));
-    aml_append(dev, method);
+    aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
crs = aml_resource_template();
      aml_append(crs, aml_io(AML_DECODE16, 0x0060, 0x0060, 0x01, 0x01));
@@ -1173,14 +1170,11 @@ static Aml *build_mouse_device_aml(void)
  {
      Aml *dev;
      Aml *crs;
-    Aml *method;
dev = aml_device("MOU");
      aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0F13")));
- method = aml_method("_STA", 0, AML_NOTSERIALIZED);
-    aml_append(method, aml_return(aml_int(0x0f)));
-    aml_append(dev, method);
+    aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
crs = aml_resource_template();
      aml_append(crs, aml_irq_no_flags(12));
@@ -2238,9 +2232,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
                                             TPM_CRB_ADDR_SIZE, 
AML_READ_WRITE));
          aml_append(dev, aml_name_decl("_CRS", crs));
- method = aml_method("_STA", 0, AML_NOTSERIALIZED);
-        aml_append(method, aml_return(aml_int(0x0f)));
-        aml_append(dev, method);
+        aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
tpm_build_ppi_acpi(tpm, dev);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]