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: 161637 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1932508jan; Tue, 2 Apr 2019 09:14:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqyeoCYp9vKSa9JTSbUjZHVLktfP41ZD/oTVs5xeZCSM6UaZYSA7dJtKlzbczK7iuL6MjHtu X-Received: by 2002:a17:902:7590:: with SMTP id j16mr35590024pll.98.1554221655619; Tue, 02 Apr 2019 09:14:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554221655; cv=none; d=google.com; s=arc-20160816; b=e6EkpKS9cyfucCYhlFblZayqgaFHOFy926LA4Zq7Zg/9u1Lk3GgxD+I4hTuxoosZFW MhyEi/o3+LqkksZYxUhwcqDEhUUTn45VWjST87Se0bqHO0BGXgnpN1GVhZ3JaBqnJZ/h U93LuSMrVwxc0AiWDpYY/7cEfkPaGpq2Vg/BRMvnCr2Pq7WjPbUixDzhHjHtlhAtOAiN Usq5miHEKx4IOp3hRCxAAmJ+yQTWnyRyflShnX5knvTCATJq3DFtxH7GjYT++XCrv8/u KNsbuV5RcGqjNeBTg4r+Fp9BzZbUaTf0QpVykynTPlXzCIOCe0ROTNy7uP2i1wLfNXYm ShMg== 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=T8iemOPqtIyaUq6dX6zg+ekp6jpn/vTXIl/9dBvRKMMTFLX8CAik2vk0vtg532EEcM 8xfTBffnHrI/UzIz7vkIgrzXWSl2UrJJpG97wfLkUf8LbjHStwBxQfeEUrt78CplrqvL TYU/juV9gXVdebhef0Aqdzir1RTUxHogvzxFl3ejEBkQDi4Lu7ePKoZ0+/uXXqYDJ0oI YsqLCDuCOuX44xef1GGa+h901uAZYqL4wKbOcEU4bqjbLvdgpB2824fmlGRD0QDrdhPC 7Lr+ctZ8mofg8XUgDRdQs/BxmjOiaBoWe0VEY4iqEKW7Ezl6lx2i3gUDjRAOlOxc0IqN jYZQ== 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-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 67si11761692plf.222.2019.04.02.09.14.15; Tue, 02 Apr 2019 09:14:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 S1731091AbfDBQOO (ORCPT + 11 others); Tue, 2 Apr 2019 12:14:14 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:36843 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731073AbfDBQOO (ORCPT ); Tue, 2 Apr 2019 12:14:14 -0400 Received: by mail-wm1-f67.google.com with SMTP id h18so4495994wml.1 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=dIDMJkWrXETKp11jJfgZTg9rBGWnwAmU5F7se6mUiZsk9fEIxuZdl1Tn+7/BOCwO0r dLnWHN+45gLlPtIuQ+YMHkoO5kFfwH6DfJ7SbNzAJNrMrFE9YWyvyllmsoR/hZWjIfAA 3xZYUoPtApyzLhCv4fwNCfi6F+WjFsZQu6w8h0AIDFEFWH4OaTYhEQCmc1S5Ri19OGAZ m5IHmoTQASG6Ri3cY+po6PerLO68htuvr/91eHiYYVVyC3PGxbIew6WbcegDkvnyoGYj qEmwqPEWnoBpmv0GI3EYPPd0CIAuTLkVaetNbeQlMT+ZGnRtHZ++IChF3yQ2VAEGWDit MGFg== X-Gm-Message-State: APjAAAVVzgp/SwFkvjxgtqW1GqcmkzZ/qYmI/kcPmLe43ovGNRwl/7sF 6tB3WO/8fN+LDTdySZ2W3E3iBA== 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-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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(-) -- 2.17.1 Acked-by: Guenter Roeck 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;