From patchwork Fri Oct 30 17:25:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 11870383 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2D89C63697 for ; Fri, 30 Oct 2020 17:26:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 817D520936 for ; Fri, 30 Oct 2020 17:26:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726829AbgJ3R0J (ORCPT ); Fri, 30 Oct 2020 13:26:09 -0400 Received: from mga05.intel.com ([192.55.52.43]:12895 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726860AbgJ3R0I (ORCPT ); Fri, 30 Oct 2020 13:26:08 -0400 IronPort-SDR: lnae59p5d2hxlTs+cmOnTh4MQaeYCdvjsQuP3HyvpwOEeKuMpH9OsSVze6KICG4qx04tMtEhy7 UsRPq0UeupbA== X-IronPort-AV: E=McAfee;i="6000,8403,9790"; a="253346914" X-IronPort-AV: E=Sophos;i="5.77,434,1596524400"; d="scan'208";a="253346914" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2020 10:26:08 -0700 IronPort-SDR: TW7n57B/MhdQtA3Ryo4oqesPvn7yu1B2kFKdLo/ypy26wji5PRg1wqeM4s3g6pqM7+aPR0qNXy YBMPhQw0zJag== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,434,1596524400"; d="scan'208";a="362506798" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 30 Oct 2020 10:26:06 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 9B81C638; Fri, 30 Oct 2020 19:26:03 +0200 (EET) From: Andy Shevchenko To: "Rafael J. Wysocki" , Len Brown , linux-acpi@vger.kernel.org Cc: Andy Shevchenko , Mika Westerberg , "Rafael J . Wysocki" Subject: [PATCH v3 6/6] ACPI: watchdog: Replace open coded variant of resource_union() Date: Fri, 30 Oct 2020 19:25:56 +0200 Message-Id: <20201030172556.21686-7-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201030172556.21686-1-andriy.shevchenko@linux.intel.com> References: <20201030172556.21686-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Since we have resource_union() helper, let's utilize it here. Signed-off-by: Andy Shevchenko Cc: Mika Westerberg Reviewed-by: Rafael J. Wysocki --- drivers/acpi/acpi_watchdog.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/acpi/acpi_watchdog.c b/drivers/acpi/acpi_watchdog.c index 5c1e9ea43123..ca28183f4d13 100644 --- a/drivers/acpi/acpi_watchdog.c +++ b/drivers/acpi/acpi_watchdog.c @@ -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; }