PCI/ACPI: Replace open coded variant of resource_union()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 3 Nov 2020 20:45:09 +0000 (22:45 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 17 Nov 2020 17:06:28 +0000 (18:06 +0100)
Since we have resource_union() helper, let's utilize it here.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Reviewed-by: Hanjun Guo <guohanjun@huawei.com>
Tested-by: Hanjun Guo <guohanjun@huawei.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/pci_root.c

index c12b5fb..0bf072c 100644 (file)
@@ -722,9 +722,7 @@ static void acpi_pci_root_validate_resources(struct device *dev,
                         * our resources no longer match the ACPI _CRS, but
                         * the kernel resource tree doesn't allow overlaps.
                         */
-                       if (resource_overlaps(res1, res2)) {
-                               res2->start = min(res1->start, res2->start);
-                               res2->end = max(res1->end, res2->end);
+                       if (resource_union(res1, res2, res2)) {
                                dev_info(dev, "host bridge window expanded to %pR; %pR ignored\n",
                                         res2, res1);
                                free = true;