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

[xen staging] x86/acpi: remove dead code



commit faa0ab2a1df0381e00d85312247024b32d60a7b9
Author:     Roger Pau Monné <roger.pau@xxxxxxxxxx>
AuthorDate: Mon Jan 11 14:58:00 2021 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Jan 11 14:58:00 2021 +0100

    x86/acpi: remove dead code
    
    After the recent changes to acpi_fadt_parse_sleep_info the bad label
    can never be called with facs mapped, and hence the unmap can be
    removed.
    
    Additionally remove the whole label, since it was used by a
    single caller. Move the relevant code from the label.
    
    No functional change intended.
    
    CID: 1471722
    Fixes: 16ca5b3f873 ('x86/ACPI: don't invalidate S5 data when S3 wakeup 
vector cannot be determined')
    Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/arch/x86/acpi/boot.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/acpi/boot.c b/xen/arch/x86/acpi/boot.c
index 0999af9d9d..ff4685279f 100644
--- a/xen/arch/x86/acpi/boot.c
+++ b/xen/arch/x86/acpi/boot.c
@@ -382,8 +382,14 @@ acpi_fadt_parse_sleep_info(const struct acpi_table_fadt 
*fadt)
                }
        }
 
-       if (fadt->flags & ACPI_FADT_HW_REDUCED)
-               goto bad;
+       if (fadt->flags & ACPI_FADT_HW_REDUCED) {
+               memset(&acpi_sinfo, 0,
+                      offsetof(struct acpi_sleep_info, sleep_control));
+               memset(&acpi_sinfo.sleep_status + 1, 0,
+                      (long)(&acpi_sinfo + 1) -
+                      (long)(&acpi_sinfo.sleep_status + 1));
+               return;
+       }
 
        acpi_fadt_copy_address(pm1a_cnt, pm1a_control, pm1_control);
        acpi_fadt_copy_address(pm1b_cnt, pm1b_control, pm1_control);
@@ -451,15 +457,6 @@ acpi_fadt_parse_sleep_info(const struct acpi_table_fadt 
*fadt)
        printk(KERN_INFO PREFIX
               "            wakeup_vec[%"PRIx64"], vec_size[%x]\n",
               acpi_sinfo.wakeup_vector, acpi_sinfo.vector_width);
-       return;
-
- bad:
-       if (facs)
-               acpi_os_unmap_memory(facs, sizeof(*facs));
-       memset(&acpi_sinfo, 0,
-              offsetof(struct acpi_sleep_info, sleep_control));
-       memset(&acpi_sinfo.sleep_status + 1, 0,
-              (long)(&acpi_sinfo + 1) - (long)(&acpi_sinfo.sleep_status + 1));
 }
 
 static int __init acpi_parse_fadt(struct acpi_table_header *table)
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.