diff mbox series

[4/6] acpi: drop pointless _STA method

Message ID 20200327121111.1530-5-kraxel@redhat.com (mailing list archive)
State New, archived
Headers show
Series acpi: i386 tweaks | expand

Commit Message

Gerd Hoffmann March 27, 2020, 12:11 p.m. UTC
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 <kraxel@redhat.com>
---
 hw/i386/acpi-build-pc.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

Comments

Igor Mammedov March 27, 2020, 2:21 p.m. UTC | #1
On Fri, 27 Mar 2020 13:11:09 +0100
Gerd Hoffmann <kraxel@redhat.com> 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 <kraxel@redhat.com>

nice,

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

ps:

maybe somewhere in earlier patches s/acpi-build-pc.c/pc-acpi.c/

> ---
>  hw/i386/acpi-build-pc.c | 14 +++-----------
>  1 file changed, 3 insertions(+), 11 deletions(-)
> 
> diff --git a/hw/i386/acpi-build-pc.c b/hw/i386/acpi-build-pc.c
> index 3fdae2984b91..18ca2fd46961 100644
> --- a/hw/i386/acpi-build-pc.c
> +++ b/hw/i386/acpi-build-pc.c
> @@ -1137,14 +1137,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));
> @@ -1159,14 +1156,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));
> @@ -2229,9 +2223,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);
>
diff mbox series

Patch

diff --git a/hw/i386/acpi-build-pc.c b/hw/i386/acpi-build-pc.c
index 3fdae2984b91..18ca2fd46961 100644
--- a/hw/i386/acpi-build-pc.c
+++ b/hw/i386/acpi-build-pc.c
@@ -1137,14 +1137,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));
@@ -1159,14 +1156,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));
@@ -2229,9 +2223,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);