From patchwork Tue Apr 2 16:12:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 10882051 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C93D2139A for ; Tue, 2 Apr 2019 16:14:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B619C2871F for ; Tue, 2 Apr 2019 16:14:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AA3DD2878F; Tue, 2 Apr 2019 16:14:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4656B2871F for ; Tue, 2 Apr 2019 16:14:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731092AbfDBQOO (ORCPT ); Tue, 2 Apr 2019 12:14:14 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:39831 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730317AbfDBQOO (ORCPT ); Tue, 2 Apr 2019 12:14:14 -0400 Received: by mail-wm1-f68.google.com with SMTP id n25so4463151wmk.4 for ; Tue, 02 Apr 2019 09:14:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HADuYtPTNrxpcN8kfE8Fku8tuLIuxpjkI5Oi1Be3G+o=; b=VQzkuU6SBsI98fiYXZpMHIm4v6bJFj9DTp/Q0+njwXd9g6T7vvq8oKQVvBy8POX64z 5vZQVrz0AKWEdIluRz8JSLlHcp6X8mbXSuYTW7nC2pHZK1nnmaxYpkicTyv6RrBr+zyF aDwbPBl+tZR2J9MH2qET6MDXNSgHIacNEL0R14ZhiI5+5ObMyusO174A78Ofm4PhCWkP hiuqnFKNbY89My7MINVDjxlYcugon8F3U70n71YVPJdis0NdO7HOPDvfFET2oixMAlEQ 4enFDZncak6/0+L1JMg3OrXrl5vVtXC/onRA1c3mpURyupAfP6TLsx91XU/NxehbW90O 7FAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HADuYtPTNrxpcN8kfE8Fku8tuLIuxpjkI5Oi1Be3G+o=; b=FnrA4IY8RC3sl4OCC83e/LQgOhq8hGyKaAuXvBIwRQK2wiAcArzG+cmS3MQEYFrrAn 3h2nswnVlCtJTvacnu3+OHNJNQUyyZ258YNVwya/FAy0VqGdi2BJ2CLF5x63hqIkk8gY lCABxYD4x936JQy8HCyuHB5tnn5I/b6X1LmKkC6h7ufxQYjA5uOhs1PXEAn2uOtUgbo/ RZwhjOqTSE/L15xqIw5isC81J3XCz/+pSv9Uk9Y/E+QtSet72b1L6BWjhRh4pk7S+vyu uhVoPO//Hr9PVVXlMR8dErtUbNwBQPOv/pt5uzvvGuORE1YOymlTPjChWcymUapQvTRs RkkA== X-Gm-Message-State: APjAAAUdwgkRmAfRgf4fY1EXXhn24NzUee5PJGJ8jLhx9RvYmWc9aCvf 0wdnMpel/NhUTEaskFrM5S/0FUAybrKJvQ== X-Google-Smtp-Source: APXvYqzughbuoj39u5xAwXrVWiAdEaqUxu3pHQ2yxhtcHIv40hj2ARyQPUCITlM522cVS+LN1X4omw== X-Received: by 2002:a1c:f310:: with SMTP id q16mr4100693wmq.102.1554221652721; Tue, 02 Apr 2019 09:14:12 -0700 (PDT) Received: from mai.imgcgcw.net (sju31-1-78-210-255-2.fbx.proxad.net. [78.210.255.2]) by smtp.gmail.com with ESMTPSA id a126sm17054999wmh.4.2019.04.02.09.14.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Apr 2019 09:14:12 -0700 (PDT) From: Daniel Lezcano To: rui.zhang@intel.com, edubezval@gmail.com Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org (open list:HARDWARE MONITORING) Subject: [PATCH 7/7] hwmon/drivers/core: Simplify complex dependency Date: Tue, 2 Apr 2019 18:12:50 +0200 Message-Id: <20190402161256.11044-7-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190402161256.11044-1-daniel.lezcano@linaro.org> References: <20190402161256.11044-1-daniel.lezcano@linaro.org> Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As the thermal framework does not longer compile as a module, we can simplify this condition below: if IS_REACHABLE(CONFIG_THERMAL) && defined(CONFIG_THERMAL_OF) && \ (!defined(CONFIG_THERMAL_HWMON) || \ !(defined(MODULE) && IS_MODULE(CONFIG_THERMAL))) if IS_REACHABLE(CONFIG_THERMAL) && defined(CONFIG_THERMAL_OF) && \ (!defined(CONFIG_THERMAL_HWMON) || \ !(defined(MODULE) && 0)) => (whatever && 0) = 0 if IS_REACHABLE(CONFIG_THERMAL) && defined(CONFIG_THERMAL_OF) && \ (!defined(CONFIG_THERMAL_HWMON) || !(0)) if IS_REACHABLE(CONFIG_THERMAL) && defined(CONFIG_THERMAL_OF) && \ (!defined(CONFIG_THERMAL_HWMON) || 1) => (whatever || 1) = 1 if IS_REACHABLE(CONFIG_THERMAL) && defined(CONFIG_THERMAL_OF) && \ (1) => (whatever && 1) = whatever if IS_REACHABLE(CONFIG_THERMAL) && defined(CONFIG_THERMAL_OF) CONFIG_THERMAL can not be a module anymore, then: if defined(CONFIG_THERMAL) && defined(CONFIG_THERMAL_OF) And CONFIG_THERMAL_OF already depends on CONFIG_THERMAL, so: if defined(CONFIG_THERMAL_OF) Thus, ifdef CONFIG_THERMAL_OF Signed-off-by: Daniel Lezcano Acked-by: Guenter Roeck --- drivers/hwmon/hwmon.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c index c22dc1e07911..6f76f2484db0 100644 --- a/drivers/hwmon/hwmon.c +++ b/drivers/hwmon/hwmon.c @@ -118,9 +118,7 @@ static DEFINE_IDA(hwmon_ida); * The complex conditional is necessary to avoid a cyclic dependency * between hwmon and thermal_sys modules. */ -#if IS_REACHABLE(CONFIG_THERMAL) && defined(CONFIG_THERMAL_OF) && \ - (!defined(CONFIG_THERMAL_HWMON) || \ - !(defined(MODULE) && IS_MODULE(CONFIG_THERMAL))) +#ifdef CONFIG_THERMAL_OF static int hwmon_thermal_get_temp(void *data, int *temp) { struct hwmon_thermal_data *tdata = data;