Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1461488yba; Tue, 2 Apr 2019 09:16:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqwU3kGZa9+ni6rhP8822TM7eczk3GlaFbSzZsjBI5/M2yehS3cfXpr30iXLxpTomFnPPyYf X-Received: by 2002:a63:ad4b:: with SMTP id y11mr54146658pgo.405.1554221769692; Tue, 02 Apr 2019 09:16:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554221769; cv=none; d=google.com; s=arc-20160816; b=PCSgEYB7rdJw8hDseRAGrx8HIW0xPfDVkTCpInwPNlseu9EfOwIEhO6KoOHM9EYMtS NkHwfGCsblEAXt9a1vqDF8ykmubwXsRu+5c+tB1NvMNzPNfEoh15cU7BpV22lyu9wKNF sq2DccqZTJvy+RbsX+Kc4IhmyVPq5nR+uvRgsRygp8e6uqPVG1SzXMnnC6+A/HHO46DO 3BP9+gqxVaW0pMD4hZnDYQG6hkcbYz8q9BSa3Z1c5teRFq+417G0150NN1nHnZOT9jcn RPKW4ayYdw/CvmcXVNhk2vqZk6hPZt6wgwq9CSEq5qCaHD4OKb+jjGgPCks+SGYdSsS1 OLyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=HADuYtPTNrxpcN8kfE8Fku8tuLIuxpjkI5Oi1Be3G+o=; b=nuSehu0AtNPtz7+ciuEMU0MQd6eLTLm1LdCN/lAq7NHKBao+OMJSj4ViRXrXCtaS6U e+v2N7wFOSaWgMlopcNRfqnReQ0ll29VtzxQA2+ej+0M0ACqfQmUfGcbJ93YiezvHTUV mQaiRmL8Y5lmqkzRGgYm8zBAF8khMb2xN/A6WxVFkEyWlVK7/FbS2ogQ2JrB7Doo1mst unqGdbtBApIIj0rNG96o9Q/cjNq+0ZzJ3N3rX+wRjfvZzzzq8wbO2iVWJQTzliJ1YISk Ji18WCL2MyVUdaA3nAC/3Ok3Z1LYmAIsqV/KpMtkDj/+7shFYNwOxiWxoLlPi793HLrK sumg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VQzkuU6S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h25si3161966pgv.244.2019.04.02.09.15.53; Tue, 02 Apr 2019 09:16:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VQzkuU6S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731156AbfDBQOP (ORCPT + 99 others); Tue, 2 Apr 2019 12:14:15 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:38782 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731078AbfDBQOO (ORCPT ); Tue, 2 Apr 2019 12:14:14 -0400 Received: by mail-wm1-f67.google.com with SMTP id w15so4480895wmc.3 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=X+mpytid4z9eOirHEJrxiaGPh7Nse+gfrVUzcYODYp8eXFN8sxQWVap20fosJqNidA DQrxf1xPjRmogjMu0jGFBnThUwMV3lcR1OPGNqKufyLXVY/dU0nPglNgHEPKdIrnk2Ff F0SRQew70FJSNSmk5xr/b64RMWHK9PSXQJiuvlxj+jm/LBWILtAHS7M7EKq0YWqq/LRm dcSr4JQju9LRUzG6Vebur4KM4BHUuquxW8iEyaKo2lEN6Okvv9CCpNZiaAW0rjFzCX05 01b8hzOlt7vnp3JUs66vnvIGiBtS/UxteXpiIyP4T7mM/k1ICrlK+EldrXBXC9xyQJNh GH9g== X-Gm-Message-State: APjAAAV5KsKe4lq/ySII59T260hplJAlvu1Xr8KOKwtxry7PoY3Ro76x TNECX07DshG7w6HxoE6S11fiig== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; -- 2.17.1