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

[PATCH] x86/acpi: remove dead code


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Mon, 11 Jan 2021 10:26:40 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lVc0omBGxQy5myioyBcmnTwUPIFu9YdivSgFQh+am0U=; b=BZpVqr7oCedJLfOzxIqRnvIf532qGtNTMGO5nUsLn/v+A0obNTua9X8wvZvhQKL4QIUL/RpYg0K0BgLt6T9CW0F5hWvB0UNrruAmq2kUI+c/JPkDUc11PizL0kgd0IXjyFc36V+zF9uRzumZsuVGvJ5uXgJ7o3f5ed4FyhaBI9kI7pmJ0l/QbgE0fLnqeGBj873J39w7nU33yPtP2e/Lw0dNtevEsvI/EOv1xrqjvavzep6IM1OqW0lyMkUW1Ar815ZnWU0xAcRPrvhq3sH3FXhmpA/dgEfbkDWlMWVLyM/WbIRusa0ss7Z/w9b3TVjkHCddSIQlDiIrvcJ+MjvYAQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=caYoh5zt2LOHqBjSkyaD2JfnkwR4DZjuQVXiXeM+nIt3C0foGmDLmQGX3iBkWQ/EV3zqDVTkhZ/FqLOpEU5yuKJgTscV7DfEFv8xg9N/V3lnlPM3r7tj307YCUSjfoRTR65CnDr1k+A/HSSdZvByAy0gc7gm50J0jIKNwqlprT36bVGbMWsvb8SoOzfWd98tx117A30K4mZoNt1tWusV5/dHbva6BU7tw/48udPpAJEFefPPlexXLrbX2wy9c0VrwiwEgxHVNqx0EwzDym8wrOHycZP9R4aB4podggfLsuESaBjfkRPZqAWavWBgj/IPgmayJEgTieYqQU8Do13oqg==
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Mon, 11 Jan 2021 09:27:05 +0000
  • Ironport-sdr: cIaMMCDAbsde45zJPIr4K+QHJarlzPWAYLpy78FhvSOGdQwX1GJwa8TZxDdDjIJuL4XKe9jQty UnRo02RNbFvh/HMi3rd2eloIfTtmGdpi0tVgkfBPBdu5RByy9p3lt5RI8bmhHYtL3AR9W5bJJz +SmXATD1dtR7VcEoS/UgbTQPgHosTXP/upLrnxSJP9Lgnet3TNFEfYFR1uvsT4O9B+aRzflnzj EdAYSfDFMwC8AEZAquvG7fglMjc2ISwuMdFsNh4p0cpx5ml+xaM9S3MYkOT7hZn6qFXjkipxdB 55g=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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>
---
 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 6345490f93..73a321d83c 100644
--- a/xen/arch/x86/acpi/boot.c
+++ b/xen/arch/x86/acpi/boot.c
@@ -389,8 +389,14 @@ acpi_fadt_parse_sleep_info(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);
@@ -458,15 +464,6 @@ acpi_fadt_parse_sleep_info(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)
-- 
2.29.2




 


Rackspace

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