ACPI: watchdog: Replace open coded variant of resource_union()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 3 Nov 2020 20:45:10 +0000 (22:45 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 17 Nov 2020 17:06:29 +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: Hanjun Guo <guohanjun@huawei.com>
Tested-by: Hanjun Guo <guohanjun@huawei.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpi_watchdog.c

index 5c1e9ea43123e94de355cc4cc5fd906aab6fd8ea..ca28183f4d1329ea22aa4c775c66334da91c7d06 100644 (file)
@@ -151,11 +151,7 @@ void __init acpi_watchdog_init(void)
                found = false;
                resource_list_for_each_entry(rentry, &resource_list) {
                        if (rentry->res->flags == res.flags &&
-                           resource_overlaps(rentry->res, &res)) {
-                               if (res.start < rentry->res->start)
-                                       rentry->res->start = res.start;
-                               if (res.end > rentry->res->end)
-                                       rentry->res->end = res.end;
+                           resource_union(rentry->res, &res, rentry->res)) {
                                found = true;
                                break;
                        }