From patchwork Thu Apr 2 14:27:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 212419 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=-9.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,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 F28D5C43331 for ; Thu, 2 Apr 2020 14:28:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C2C3D2078E for ; Thu, 2 Apr 2020 14:28:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Cxn+mi5l" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732492AbgDBO2F (ORCPT ); Thu, 2 Apr 2020 10:28:05 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:36808 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726368AbgDBO2F (ORCPT ); Thu, 2 Apr 2020 10:28:05 -0400 Received: by mail-wr1-f68.google.com with SMTP id 31so4471013wrs.3 for ; Thu, 02 Apr 2020 07:28:02 -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; bh=L6/ijDa/Jd9lpmxJXYPH3CFr+MtNwUzGkblaHQTuEUE=; b=Cxn+mi5l8LNcQ9ooeTVNyp7YknSO5b0dzRvVoadai2f9VqETOlr7uW+s2jR5paIkPV 9FuWrxFWvscGJ0X8P1sDj7EeEOsKRVjYsEXZcCDsVs26wsti5C56AAdP8QWFz6wXeaHF NTGZzWjxHI8/HKg3RyfaeNaXP8pVJYkQAZamfx953+Gwt7Huv7wc+GXGjUWL73KdYblM cA2Eb5ZO6bdNzqEtRwF6IAJHnjcmBUZRmFK+FDf2gO0lMF5hi8lKxCQijDbjRVwTSM7e qF12rf/yC5hAd5qU1IS5AiCQmgyzVTuMmY9apGgF/1cauc3E5aEndR8dpiFNf1O2XBd8 cqhA== 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; bh=L6/ijDa/Jd9lpmxJXYPH3CFr+MtNwUzGkblaHQTuEUE=; b=SQfsQdvD/z3xn8KRt5XkgHRiL0VgYLMj8GYFoN213B7IlJVu2PwwpP1p6b20t0VQVZ CPyuZ0fca5CiEFWBz2ENALSOQrbVXfKNBmO0qRIajeX0nq2BRCWbRcbuQ9cu8iR5t/1p I9/5kygHJmhTVr+lIDxVHAD85/Vc5h5JpcHD3zMD83O3kwovz/Ps3UDPvRet/o4vtO32 eW6hX28nWwgKJuMnEhqyw8tLVcDspqTBwBC0h/Z/T6RNyUO5FZkdUMLBrdGT37z7mRNH ENBlyyrfkdA2DixoDJOgkpsnfxUewnS+h57BGeVA3wzsc3Y93ZxhAQcDi83DYy1eBnkf Jf/w== X-Gm-Message-State: AGi0PuZwR8Kb9QIcxngf2JUYYLw1eoysDioQnDgqCdKEQY1mH7YixtXK lHUI4aqLe2dsiXpQ+rw0YibXyw== X-Google-Smtp-Source: APiQypIUdnQDDdOEoeXFn6SQz3wAN0BAYyPNar/ytXY1aSsVIPaUfDXx8RyvFPho8qNwZDC8esAm6Q== X-Received: by 2002:a5d:53ce:: with SMTP id a14mr3711084wrw.129.1585837681758; Thu, 02 Apr 2020 07:28:01 -0700 (PDT) Received: from mai.imgcgcw.net ([2a01:e34:ed2f:f020:4b2:e366:e86f:261a]) by smtp.gmail.com with ESMTPSA id a7sm7045186wmm.34.2020.04.02.07.28.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Apr 2020 07:28:01 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rui.zhang@intel.com Cc: amit.kucheria@verdurent.com, linux-pm@vger.kernel.org (open list:THERMAL), linux-kernel@vger.kernel.org (open list) Subject: [PATCH V2 1/9] thermal: Move default governor config option to the internal header Date: Thu, 2 Apr 2020 16:27:39 +0200 Message-Id: <20200402142747.8307-1-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The default governor set at compilation time is a thermal internal business, no need to export to the global thermal header. Move the config options to the internal header. Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_core.h | 11 +++++++++++ include/linux/thermal.h | 11 ----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h index 37cd4e2bead2..828305508556 100644 --- a/drivers/thermal/thermal_core.h +++ b/drivers/thermal/thermal_core.h @@ -12,6 +12,17 @@ #include #include +/* Default Thermal Governor */ +#if defined(CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE) +#define DEFAULT_THERMAL_GOVERNOR "step_wise" +#elif defined(CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE) +#define DEFAULT_THERMAL_GOVERNOR "fair_share" +#elif defined(CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE) +#define DEFAULT_THERMAL_GOVERNOR "user_space" +#elif defined(CONFIG_THERMAL_DEFAULT_GOV_POWER_ALLOCATOR) +#define DEFAULT_THERMAL_GOVERNOR "power_allocator" +#endif + /* Initial state of a cooling device during binding */ #define THERMAL_NO_TARGET -1UL diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 448841ab0dca..71cff87dcb46 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -32,17 +32,6 @@ /* use value, which < 0K, to indicate an invalid/uninitialized temperature */ #define THERMAL_TEMP_INVALID -274000 -/* Default Thermal Governor */ -#if defined(CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE) -#define DEFAULT_THERMAL_GOVERNOR "step_wise" -#elif defined(CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE) -#define DEFAULT_THERMAL_GOVERNOR "fair_share" -#elif defined(CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE) -#define DEFAULT_THERMAL_GOVERNOR "user_space" -#elif defined(CONFIG_THERMAL_DEFAULT_GOV_POWER_ALLOCATOR) -#define DEFAULT_THERMAL_GOVERNOR "power_allocator" -#endif - struct thermal_zone_device; struct thermal_cooling_device; struct thermal_instance; From patchwork Thu Apr 2 14:27:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 212415 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=-9.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable 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 69CC4C2BA1E for ; Thu, 2 Apr 2020 14:28:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3F8412145D for ; Thu, 2 Apr 2020 14:28:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="GxstHCjI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387678AbgDBO2g (ORCPT ); Thu, 2 Apr 2020 10:28:36 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:42189 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732450AbgDBO2G (ORCPT ); Thu, 2 Apr 2020 10:28:06 -0400 Received: by mail-wr1-f65.google.com with SMTP id h15so4439687wrx.9 for ; Thu, 02 Apr 2020 07:28:03 -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=NLgc/Vk2F+SuJNrnjX/emMROOJG4WMJyyJx9N+UIrh4=; b=GxstHCjIcfORLMIREXB1QHdgE3pGnEEDm4SN6Zi8TGTVrQ5CYV/5BkwWKgiYvoAU8w oPkzh+OZt30LJizbeh1vI6cCf1I5mvjwyVIDr2N1BVpnOFOzpHUynqTrHNvge3trdt8s z+DrEt8f9zRs1wAUruYW91YM0tPhnlvrjuboMvmacQlYLa/a3dLsW8vFykPkmsm3UwfI SGb4Xjviydgq9PxNH54skVVxPL+mRS/d/V8JvkHcg80c/IvXF5RasnfNeO+aQtxbP48n RKDLMAc+IYNII0UuAtkrPLH0Eh7linMx0P+ErJViaEaTzwdgeHH9yDe+1Mm3xRvwzRyg uWUA== 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=NLgc/Vk2F+SuJNrnjX/emMROOJG4WMJyyJx9N+UIrh4=; b=WZ7BUOJdsr2TjlUmGBsF1+SW3HPUL+e0bZrm6NnxY4eQ+PrCKsBqlC63x7Ql39TetV 4uCffNSCyNI2OeyMxRnFUgeI1sUx0J0eKR3o8I/CvOHq2UaCr4RDGkaiiN8g45XE5cNr x22aNF3AdnlcwLIpWYt2qiIN0AWcQdGzENLXY/MpwDru5aZ/bk2o5DszARdYDJl/L0Nt yO9g5L5KR0scF7fdxkagDR+ZNHOo+ge5X1cjvS3/lDrdMqsRNhzWJxQhV9mICpn2hgf+ WbzLYQVuhhWVNI3vDBJ8ZAP485cxucL+qaliVrudUYTdoVaCGxtMuI4V6IoMLJZkvwcn Ue0w== X-Gm-Message-State: AGi0PuaV9MszayOj6otJmJlc/raNoRfHS1sErpin6vdRkYGu9RnTRJUF MY6LVWn09tFOU3IUAX3SHPVkjg== X-Google-Smtp-Source: APiQypIcclPEKfDgcgG4EZu6WTNMliilqfI+B3Z3wV1gY2jZDEbMOaBz3Lm35cEFBrnGJ5M003Pyeg== X-Received: by 2002:adf:a21a:: with SMTP id p26mr3843764wra.102.1585837682934; Thu, 02 Apr 2020 07:28:02 -0700 (PDT) Received: from mai.imgcgcw.net ([2a01:e34:ed2f:f020:4b2:e366:e86f:261a]) by smtp.gmail.com with ESMTPSA id a7sm7045186wmm.34.2020.04.02.07.28.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Apr 2020 07:28:02 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rui.zhang@intel.com Cc: amit.kucheria@verdurent.com, linux-pm@vger.kernel.org (open list:THERMAL), linux-kernel@vger.kernel.org (open list) Subject: [PATCH V2 2/9] thermal: Move struct thermal_attr to the private header Date: Thu, 2 Apr 2020 16:27:40 +0200 Message-Id: <20200402142747.8307-2-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200402142747.8307-1-daniel.lezcano@linaro.org> References: <20200402142747.8307-1-daniel.lezcano@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The structure belongs to the thermal core internals but it is exported in the include/linux/thermal.h For better self-encapsulation and less impact for the compilation if a change is made on it. Move the structure in the thermal core internal header file. Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_core.h | 5 +++++ include/linux/thermal.h | 6 +----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h index 828305508556..5d08ad60d9df 100644 --- a/drivers/thermal/thermal_core.h +++ b/drivers/thermal/thermal_core.h @@ -41,6 +41,11 @@ extern struct thermal_governor *__governor_thermal_table_end[]; __governor < __governor_thermal_table_end; \ __governor++) +struct thermal_attr { + struct device_attribute attr; + char name[THERMAL_NAME_LENGTH]; +}; + /* * This structure is used to describe the behavior of * a certain cooling device on a certain trip point diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 71cff87dcb46..5aa80fb2fb61 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -35,6 +35,7 @@ struct thermal_zone_device; struct thermal_cooling_device; struct thermal_instance; +struct thermal_attr; enum thermal_device_mode { THERMAL_DEVICE_DISABLED = 0, @@ -119,11 +120,6 @@ struct thermal_cooling_device { struct list_head node; }; -struct thermal_attr { - struct device_attribute attr; - char name[THERMAL_NAME_LENGTH]; -}; - /** * struct thermal_zone_device - structure for a thermal zone * @id: unique id number for each thermal zone From patchwork Thu Apr 2 14:27:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 212416 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=-9.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable 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 9AEFDC2BA1E for ; Thu, 2 Apr 2020 14:28:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 70D742080C for ; Thu, 2 Apr 2020 14:28:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="NFl7TC+a" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387732AbgDBO2d (ORCPT ); Thu, 2 Apr 2020 10:28:33 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:37419 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387678AbgDBO2I (ORCPT ); Thu, 2 Apr 2020 10:28:08 -0400 Received: by mail-wr1-f67.google.com with SMTP id w10so4495996wrm.4 for ; Thu, 02 Apr 2020 07:28:07 -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=IRbhPZus5ePLwsnnR/FLUI/loMrHCnubDThlTfowdJE=; b=NFl7TC+azwhOe/7urYy+7eOYrC7ACMCVAA9nMMJtjl34LIpAK8x2yxcdQB1fYxkRY4 BP1w3O/jmbITRQ0YFfN7hdI2NC9XQ8XhB25dE8slVVaqmLX0YdNUMg1x9VJ8MeSQmTK6 WSTYM9yr+/rE90fTLsob948PY5WZgmRxYVNx4/VHv6j5BsvtzmwAQDXPlrE8myMrZAxb 8k9I4E8oqw+K94coZFjyhgaA1GWHWSILNk5T24JMnJY//M+eEhqFlJCdL1Bd29wdK481 yQEiboUChPwfiC/rZcl31auKBYhc7skf0kDWvblsflXdbnZUpSTsLMP3aJQqxha5U0vZ vZrw== 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=IRbhPZus5ePLwsnnR/FLUI/loMrHCnubDThlTfowdJE=; b=E2JjpNlYUEEXESjKiqixujoblW58tLClXORXiNxq8cXqyg5PJ+DFUxvA8/+dawBeIZ QIGHpqpR6EUn+2h2OGdFmiN+naRNFm1T0KVfMEPessWz6ze3w58UIFlvJyeioYx8o4Ev ZtHbTZZPee1aEv05t90PxNWkeT733FHbm5CzoH12Ucc7XZ7G+ibDwKEtYsMj/lEXjUtI 48A8/ulzvmLN2Hm4bNLvMb84NOHZNHTclc8exhbWAb/1ZtmsYNmlPPETpejkRAocHA56 vDA2HATmVoQuNJps2+uXtwgiTR/muZO6KkbigUeoVPfShKgmCp0o9NuTzwuMpIiMExUU w0UQ== X-Gm-Message-State: AGi0PuawLXxDTEtnOXdO7/UaSxnxej1LuR+pXzutiivEh8rb6ZPJzwVk 1WicpCy1uuIGlAuekwA54IFc4w== X-Google-Smtp-Source: APiQypJC+E8+VpCIFIw5PcQuQk87nUsoE/ony9aWUiWYpNifN0jcFbqSr2cQu9avwx+x3OeWmIb2Cw== X-Received: by 2002:adf:e946:: with SMTP id m6mr3944587wrn.187.1585837686998; Thu, 02 Apr 2020 07:28:06 -0700 (PDT) Received: from mai.imgcgcw.net ([2a01:e34:ed2f:f020:4b2:e366:e86f:261a]) by smtp.gmail.com with ESMTPSA id a7sm7045186wmm.34.2020.04.02.07.28.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Apr 2020 07:28:06 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rui.zhang@intel.com Cc: amit.kucheria@verdurent.com, linux-pm@vger.kernel.org (open list:THERMAL), linux-kernel@vger.kernel.org (open list) Subject: [PATCH V2 5/9] thermal: Move get_tz_trend to the internal header Date: Thu, 2 Apr 2020 16:27:43 +0200 Message-Id: <20200402142747.8307-5-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200402142747.8307-1-daniel.lezcano@linaro.org> References: <20200402142747.8307-1-daniel.lezcano@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The function is not used any place other than the thermal directory. It does not make sense to export its definition in the global header as there is no use of it. Move the definition to the internal header and allow better self-encapsulation. Take the opportunity to add the parameter names to make checkpatch happy and remove the pointless stubs. Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_core.h | 2 ++ include/linux/thermal.h | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h index d37de708c28a..5fb2bd9c7034 100644 --- a/drivers/thermal/thermal_core.h +++ b/drivers/thermal/thermal_core.h @@ -72,6 +72,8 @@ struct thermal_trip { enum thermal_trip_type type; }; +int get_tz_trend(struct thermal_zone_device *tz, int trip); + /* * This structure is used to describe the behavior of * a certain cooling device on a certain trip point diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 7adbfe092281..8006ba5de855 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -414,7 +414,6 @@ int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp); int thermal_zone_get_slope(struct thermal_zone_device *tz); int thermal_zone_get_offset(struct thermal_zone_device *tz); -int get_tz_trend(struct thermal_zone_device *, int); struct thermal_instance *get_thermal_instance(struct thermal_zone_device *, struct thermal_cooling_device *, int); void thermal_cdev_update(struct thermal_cooling_device *); @@ -473,8 +472,7 @@ static inline int thermal_zone_get_slope( static inline int thermal_zone_get_offset( struct thermal_zone_device *tz) { return -ENODEV; } -static inline int get_tz_trend(struct thermal_zone_device *tz, int trip) -{ return -ENODEV; } + static inline struct thermal_instance * get_thermal_instance(struct thermal_zone_device *tz, struct thermal_cooling_device *cdev, int trip) From patchwork Thu Apr 2 14:27:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 212417 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=-9.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable 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 12FDDC2BA19 for ; Thu, 2 Apr 2020 14:28:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DB4D220857 for ; Thu, 2 Apr 2020 14:28:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="o/I/qpgo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387985AbgDBO2V (ORCPT ); Thu, 2 Apr 2020 10:28:21 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:39296 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732950AbgDBO2K (ORCPT ); Thu, 2 Apr 2020 10:28:10 -0400 Received: by mail-wr1-f65.google.com with SMTP id p10so4453396wrt.6 for ; Thu, 02 Apr 2020 07:28:08 -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=uPGWZu5ngtNrn+ryPQoiCELQ8McZSJI9oUiugafXI6g=; b=o/I/qpgoI9N99qSUGVAT2YPVoswXsiEWtTfuGeSlJdhScbZ3X4vD5MITtdD2ivhgJ5 OCri0l9wcpQJH5ocUtjZ5Mdbw8P+zrmnJ2jW9g47zE9Un0xoBZbELZfmQM3pUbwoW5Hk QYfoDeM2UKlcIgfTIhbwdfRhtGh+0wATUYmx0tjnHiLebUpMjYl8cySoCI7nr94JlyFr 4qc4WRUkQGnplFloQnD+CMGlosHCl4eJxz4S3mheJqioDBkstd4mN8zOo5DePghB9u3N oI9BffCtmo2mmHgwxB79zp1kyEccpVKI5YqsTsn3KMjxsXqLzIjAFftiRQnIMsnC7HIk SerQ== 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=uPGWZu5ngtNrn+ryPQoiCELQ8McZSJI9oUiugafXI6g=; b=cJo/+Durvu5HfyOGjoX+dQEcm32kxdVL01TXv+krfAi15CIbxSeigz5mu4+T4F8G/J 37QOAIXPFh1delMrXzQcuRyFOtbkv3S/GAw40e3tUOzDiLGy26jiM4+q2U3Dwy87/T9G iMKSR4dq+qomXdJSVSPNnGO4+9/c/KGdU6BOEVeHbH+u4JX4auU8+Fi1KfhmSEH9WiKO y/FIu9xke0dIPOdYn5M4YZLu/ohZeroX5nZOSXfl6PLwDjCKPnKlOuuJ4kqZQqcyQxrl wDZqrMk1FkYJTeW/7Qxj+oXbgquywfnYks8VYBvXxTQjJqgXuQKWMDd8txwcxyOA6s6f y4Xw== X-Gm-Message-State: AGi0PuYySQVByd+Dtr6n4cWGftf/3GxruFeNMaDGmW8r5bCCnZcsn51v cwn2Xft56tIYpHsPNMF91aKgwQ== X-Google-Smtp-Source: APiQypLr+kmTgxc1wi7I6ig12mHv0Z8OIQw228a6dHKFf0g2cnttGL+l6yk85yPVmfezHeqA+NiQag== X-Received: by 2002:a05:6000:1251:: with SMTP id j17mr3845212wrx.228.1585837688069; Thu, 02 Apr 2020 07:28:08 -0700 (PDT) Received: from mai.imgcgcw.net ([2a01:e34:ed2f:f020:4b2:e366:e86f:261a]) by smtp.gmail.com with ESMTPSA id a7sm7045186wmm.34.2020.04.02.07.28.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Apr 2020 07:28:07 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rui.zhang@intel.com Cc: amit.kucheria@verdurent.com, linux-pm@vger.kernel.org (open list:THERMAL), linux-kernel@vger.kernel.org (open list) Subject: [PATCH V2 6/9] thermal: Move get_thermal_instance to the internal header Date: Thu, 2 Apr 2020 16:27:44 +0200 Message-Id: <20200402142747.8307-6-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200402142747.8307-1-daniel.lezcano@linaro.org> References: <20200402142747.8307-1-daniel.lezcano@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The function is not used any place other than the thermal directory. It does not make sense to export its definition in the global header as there is no use of it. Move the definition to the internal header and allow better self-encapsulation. Take the opportunity to add the parameter names to make checkpatch happy and remove the pointless stubs. Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_core.h | 5 +++++ include/linux/thermal.h | 6 ------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h index 5fb2bd9c7034..c95689586e19 100644 --- a/drivers/thermal/thermal_core.h +++ b/drivers/thermal/thermal_core.h @@ -74,6 +74,11 @@ struct thermal_trip { int get_tz_trend(struct thermal_zone_device *tz, int trip); +struct thermal_instance * +get_thermal_instance(struct thermal_zone_device *tz, + struct thermal_cooling_device *cdev, + int trip); + /* * This structure is used to describe the behavior of * a certain cooling device on a certain trip point diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 8006ba5de855..47e745c5dfca 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -414,8 +414,6 @@ int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp); int thermal_zone_get_slope(struct thermal_zone_device *tz); int thermal_zone_get_offset(struct thermal_zone_device *tz); -struct thermal_instance *get_thermal_instance(struct thermal_zone_device *, - struct thermal_cooling_device *, int); void thermal_cdev_update(struct thermal_cooling_device *); void thermal_notify_framework(struct thermal_zone_device *, int); #else @@ -473,10 +471,6 @@ static inline int thermal_zone_get_offset( struct thermal_zone_device *tz) { return -ENODEV; } -static inline struct thermal_instance * -get_thermal_instance(struct thermal_zone_device *tz, - struct thermal_cooling_device *cdev, int trip) -{ return ERR_PTR(-ENODEV); } static inline void thermal_cdev_update(struct thermal_cooling_device *cdev) { } static inline void thermal_notify_framework(struct thermal_zone_device *tz, From patchwork Thu Apr 2 14:27:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 212418 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=-7.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNWANTED_LANGUAGE_BODY, 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 BC55AC2BA17 for ; Thu, 2 Apr 2020 14:28:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8D5572080C for ; Thu, 2 Apr 2020 14:28:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Tgny2VVk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387891AbgDBO2N (ORCPT ); Thu, 2 Apr 2020 10:28:13 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:37429 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388120AbgDBO2N (ORCPT ); Thu, 2 Apr 2020 10:28:13 -0400 Received: by mail-wr1-f67.google.com with SMTP id w10so4496348wrm.4 for ; Thu, 02 Apr 2020 07:28:12 -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=0yL1w5+JWaXNihGaTzT6saNdFzgGKd/d3GiibbTk4FI=; b=Tgny2VVk+APSF6iZvl9xqCiKBh+PaEW7ArlCg1cSjsRXQSTQ5Yd8ToRlbKatb4fc+O DgnfDXJ6PZTB4djmgmI+pQ4aRtJHr2MG7Ep0lQUyNohXdOu5cDLB+HRvoZZ6EZh4+C6j zHx+MRDpy7Yslqc+HNi5TKkLi9djfrdg386zxVtm1ZHkrrAP8RC8c2X9FsZlVPG9OIjF l7CKHzmpeIyARD8mLMyDR598kq6m5+lTwMkg0g0BDNKAQ0VU7rxaH+kWuMEG7Ex57Lfn N2ReeB2iWjtX9QsfXz1S0iRjexW/DUMI72AxmH/xeVAb8K+NggZwgJVhnHhs3CqIrGvg giXA== 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=0yL1w5+JWaXNihGaTzT6saNdFzgGKd/d3GiibbTk4FI=; b=gNB6kTfvxvYqRtCADGMp3l7mgdHqYkZugBcWcp6RqoZVVxXlrrW4Rv4lsWgYDxbTcH jwZTnFdM8Qhf+FkUDr8OoEWI+mUK9ObDJsR9GyiOIlanc+BmmbLm+EgkEAaAa9VzgDpb wI4gF9xSfEJnbeJJv5cz4kzRfittHcSWlC4WVlTuEjjgBWUJIAXgR7EO6BeD1+xnxJzG vqKK6pAMy9bF5Vclw/MpOnKeaeKWkQe+M2IRgj2eyRvGDpLvAXQLI+NFT5Uu2QXfLj7H NPGvK/eOprtlXLwTJbMwfpr0SG6JxSCC0Chv2pzZXKaFMS8QY72ASMT4wDeNQUtCzlMv QODQ== X-Gm-Message-State: AGi0PubQtW96Mt0R5281W0O1keBMtPy/t0pbULgVqB8IiXsNx/TlmbPQ zWkP66RkU32juxbVXHTP17PztQ== X-Google-Smtp-Source: APiQypLhb4JxPDxJ1toEh0FNeaz9TM9nX/Zm+7qSIKRBmPBmdRaKUsoz+enVMUHIfk/h1R1UPepDkA== X-Received: by 2002:adf:ea8f:: with SMTP id s15mr3738685wrm.393.1585837691388; Thu, 02 Apr 2020 07:28:11 -0700 (PDT) Received: from mai.imgcgcw.net ([2a01:e34:ed2f:f020:4b2:e366:e86f:261a]) by smtp.gmail.com with ESMTPSA id a7sm7045186wmm.34.2020.04.02.07.28.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Apr 2020 07:28:10 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rui.zhang@intel.com Cc: amit.kucheria@verdurent.com, linux-pm@vger.kernel.org (open list:THERMAL), linux-kernel@vger.kernel.org (open list) Subject: [PATCH V2 9/9] thermal: Remove thermal_zone_device_update() stub Date: Thu, 2 Apr 2020 16:27:47 +0200 Message-Id: <20200402142747.8307-9-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200402142747.8307-1-daniel.lezcano@linaro.org> References: <20200402142747.8307-1-daniel.lezcano@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org All users of the function depends on THERMAL, no stub is needed. Remove it. Signed-off-by: Daniel Lezcano --- include/linux/thermal.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 7b3dbfe15b59..216185bb3014 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -426,9 +426,6 @@ static inline struct thermal_zone_device *thermal_zone_device_register( static inline void thermal_zone_device_unregister( struct thermal_zone_device *tz) { } -static inline void thermal_zone_device_update(struct thermal_zone_device *tz, - enum thermal_notify_event event) -{ } static inline struct thermal_cooling_device * thermal_cooling_device_register(char *type, void *devdata, const struct thermal_cooling_device_ops *ops)