Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1579477yba; Tue, 2 Apr 2019 11:32:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqy8dQ9akgEy9W8jF67geMVKYUZwI2PNVXpMINkexay0v/0m7N87Pp5ghJ0LPFekwhqu7Qoh X-Received: by 2002:a63:fc5a:: with SMTP id r26mr41210657pgk.97.1554229969148; Tue, 02 Apr 2019 11:32:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554229969; cv=none; d=google.com; s=arc-20160816; b=Foc1tsGYEMFSbyJOw6sL4eRpYo7jcVcqMLSSFAcmmhjnM5bFJ/WXqYjNSBoOhsTt49 zR12vujDiXoKBXPVouNUeITXJRa8K964tPZ3aQfxX6VdZXVfUXiFBsx4Bd151WbdxUcu tnIFEd47ggQx4d5d0NivmkB4O36eGRK4Gc2zoTkWLHUfqryda2qkZ1VsDReIQpPGkirY L4yH5nQXSYKzo4ySST9PjvhC/6ZkvaFNbkG8cV3PMDAoRiNLuZYnaPP6zmbOoZS8vHVo GhrH98eLjcEIhG0uvosdxQwN3tfrBAI2YKeCK8wK82U9BrIXIN7pBUJU2gdmDRyIEw4g GEMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=JJiPKxbSyy7b9dUaVB5Fz2w74T+5mLpPbXIgrMfIfWk=; b=ALG8Xpz57iWSbJXm+1MuuR7iU+zgK64MJUCI1Cb/8vtGchd8Ai0ZwdeUHaDArj8lGK s7X8+msLpbWNkB1y5q1Jiq/3xRkG4GjdR/AixDy5WO3gDuPv+aiJT4L6870Bk2kGhTLG TBDdprg3BecwaIgkZvgdwIF+fNJIbC+AJQoSkcydCRWdMEkJ/Tef1q2aKbyQzjJpcno9 U1fGBghOK6IQfw0xws3gi6H7eujx+X1JwdZkhBGGcZBgcU0xLaAaz4XS1Hsfw7rFzAyC Mmy+zwm7vbHa0tSmvZohr3ZV5QCSzHBQUWzzoh2Y5gtoZhD1RcLseeTSkwnGeYXxpf3b FQYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=P9iMoBrW; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b6si8715260plx.325.2019.04.02.11.32.34; Tue, 02 Apr 2019 11:32:49 -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=fail header.i=@gmail.com header.s=20161025 header.b=P9iMoBrW; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731105AbfDBSXz (ORCPT + 99 others); Tue, 2 Apr 2019 14:23:55 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:34932 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728748AbfDBSXz (ORCPT ); Tue, 2 Apr 2019 14:23:55 -0400 Received: by mail-pf1-f196.google.com with SMTP id t21so6794628pfe.2; Tue, 02 Apr 2019 11:23:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=JJiPKxbSyy7b9dUaVB5Fz2w74T+5mLpPbXIgrMfIfWk=; b=P9iMoBrWTcj1sVurtMnod9bbjjBv9l+QU9y/I1eh+3IuBx0ARtyiBkC+77mrxDB3KU kztnqm1ZdUFLT2YK9Z6EaSr/wUjW3ro9+HxqNbevGzms9FK9HKosZmfqSdTpndlP9h4M OI/PdTPebI8doolihNeAf36Pf1miNUDxnM8qlMbl/P4YU3e6sHyoLiw+MW69U1oU5lPD rJNFqOwAv7N0yhD+alqZKyIDeCaaj/Vptud7a8jmK1KhyAQYGweWMjgUwwPfQ+XIbxlu T+Qrq2lnC7f0qIK9oH589yTEi5e6NDu1uxVs3pJMe/wXSnSgcjtKXmE/gLEDoUwOQ5zz ASCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=JJiPKxbSyy7b9dUaVB5Fz2w74T+5mLpPbXIgrMfIfWk=; b=GftOFpBIsDk71Y0VOhelE8NHMHfCB3SDWnKLvUgJ4zdMFCKK0Bupd/68HhEZPFoVEO +CvQt8tVR9R6AOYIfLQZc8aY1nsCljS/0cnfDTyJFxc5UnAUCyXBi09y0dpooFbvvRK5 CDU2AQOTTQaI8VQB91HZHB1Gj/ZBeMKD15E2QT/BGLKinTUfdCevqhSX0MKvpFzRbpVe lnuDMa5Cn45dh5Nt6NYnfPTtQEHQTs4M5UPyDO/j4umf2MUWhmSO5+aU/k/vc/zVkkEw navguLb/PQ05D2pFTOTbsrXQQHHd6aaTAH39f7gxKlNAkyc8BSzT7FvjURFzy0XPrCdl Vf+A== X-Gm-Message-State: APjAAAWbNESlnB7ItqfJFP/4+Nxp676an4PESo5NpL539LhHlQaXTAQh x4fHDPWnHlsFkebyuUT98Yw= X-Received: by 2002:a62:4595:: with SMTP id n21mr25258075pfi.79.1554229434130; Tue, 02 Apr 2019 11:23:54 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id h19sm21129846pfd.130.2019.04.02.11.23.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Apr 2019 11:23:52 -0700 (PDT) Date: Tue, 2 Apr 2019 11:23:51 -0700 From: Guenter Roeck To: Daniel Lezcano Cc: rui.zhang@intel.com, edubezval@gmail.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Jean Delvare , "open list:HARDWARE MONITORING" Subject: Re: [PATCH 7/7] hwmon/drivers/core: Simplify complex dependency Message-ID: <20190402182351.GA12622@roeck-us.net> References: <20190402161256.11044-1-daniel.lezcano@linaro.org> <20190402161256.11044-7-daniel.lezcano@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190402161256.11044-7-daniel.lezcano@linaro.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 02, 2019 at 06:12:50PM +0200, Daniel Lezcano wrote: > 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 ... assuming this will be pushed with the series. Otherwise please let me know. Thanks, Guenter > --- > 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 >