From patchwork Sat Oct 12 06:52:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 176045 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1777752ill; Fri, 11 Oct 2019 23:53:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqzJTTUyq9CnEEEP3KxYgL8Q4fvYkMcMw9tGgfwZLQv6ZspoLu29dlD4kkswDbPjEGhS6LXQ X-Received: by 2002:a50:d54c:: with SMTP id f12mr17315416edj.116.1570863191612; Fri, 11 Oct 2019 23:53:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570863191; cv=none; d=google.com; s=arc-20160816; b=TR9T+mR78KB8t6VwnTdedcoOjGuLI+i4iZeLjJIEfnThj8y4XJFraCZyfPU5rP1OU/ b9u/uMyctEK3se2KIqVe8NdJ4qR7A4VVL+u2WMl2q9RxBp6BZUc0VE/Gjt75OqY3maJa 9AP4VEylTzJaO+uWe7qOVrbreE5FHjz891kCVqNeMZWzFh/366BAQGqDRW64iLjf5O6t q4+WPTTf26FSZ2spZUdxb0BGFJQMicaZvj/7AzRxVIX84NWykpdjZL7oMIexLwQmF0cA moWOcHx8BxvvxMtr1u7TDpRk6lde45V1Snv/SjrKiMIODvcRo5ji1PDkw0RI5b0zI7cj 520w== 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=xHcBgOBhQx/DWwTnVmG8K83D5aGb+y1z51DF9NhXCic=; b=sDhkoohG7EFyIWQ6+rsz6grRNS7b0JCKXUyZgmzB0ZnIGzjQWqLe6RhnU9SaoD4kHX DZ1gchEK19U1dqh/HxqtbBEYsqxb8R706VtvVXHkdrO3vJ9n2OkbtJFVK3TeSaoZIByI QqdEZFBhqrIqXPjwqa0/OK3CaJP/yK7hpirqBY+P5hgPlRNaQVHpDMuJinVymOCB1KMO vsHayCP3p5pmuD7NtxH8XxZylcBG6IFmhsy6lii5sZ5kzXDcydWGj0PI5zxue/Beqn6s v7LcPm0CNOpFBF9bbR/jX/X7zoaUqIuyifBG9y6qvGP/4Ww3zAYrESmYNiHzXzg5k0Wt UV0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QparcBdv; 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 j6si6603684ejj.37.2019.10.11.23.53.11; Fri, 11 Oct 2019 23:53:11 -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=QparcBdv; 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 S1729030AbfJLGxL (ORCPT + 21 others); Sat, 12 Oct 2019 02:53:11 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:40180 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726728AbfJLGxG (ORCPT ); Sat, 12 Oct 2019 02:53:06 -0400 Received: by mail-wr1-f67.google.com with SMTP id h4so14106721wrv.7 for ; Fri, 11 Oct 2019 23:53:05 -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=xHcBgOBhQx/DWwTnVmG8K83D5aGb+y1z51DF9NhXCic=; b=QparcBdvemceLiXGxQgjeJMqaa9Oth/jqWHcOmQII4NvA2oggRO+4FzltfmSn79PEv LdWXtzXkGj5Ub8z7VsT4oNBDVxez0jBNBjbNgUmGE8Vf1kv+wHJzcFHiTkr6EZDHajO1 Y3EU/VFmWfDEepS/72qNQcTgdlp5ke/dTEzctNo+WK1Ts4qZxr2IJXKlwrg6RQnXm46o HBkU2qFhN7eBhUzyYTKF9mN9UmPMbYVSldB1+21jNh3JRnlPrnJ8y3ZNZQpjJsEp4QHV HbdDQP/0vuSY8uyDKFn2tMV2A29yQHMsd5aQRUrtoLbU7q2MQjOw2I/VCUlaLg4bag+b GSiQ== 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=xHcBgOBhQx/DWwTnVmG8K83D5aGb+y1z51DF9NhXCic=; b=gwfFYRCRbDBbwdeg1DeEgIkz87Jd6+nQJ/tZserZ25cIQGBo7yP8bEN2dOfwLo6P2J 2BSgrKz4SJHZx910ksenT/YRIvo+5YyDmWjAIVdK/ydZyQ6JMiVIDPQSo0kCoBy6WI6q W65bdswZo1XZZCYJv1of9z0ibxdpuSATme7D8RsoUVHUG8r2n9uHPz0lg6jUMTkYdtwM A+zXFqsoFzjBvqvZVEFHNY5UUSw4E231YM5uQ0GVes8S/ouBRjhFqlQcJn/yMN5FWzy4 cjBMPcREaeODyMdmyIsz/3QQ7g3pT9bfc4BkZczpEvbJgAtYV4L7ZkmVXMI1zPi/OMLh +hcA== X-Gm-Message-State: APjAAAU86CZJiW70VAIvkbHcLvvQ/Wx5Zc6SBJs26vpKEyx2gMAwusEL DvtB9RDm/gCdiq8sc08Zr1iQFuAm+zk= X-Received: by 2002:a5d:614c:: with SMTP id y12mr17350876wrt.235.1570863184509; Fri, 11 Oct 2019 23:53:04 -0700 (PDT) Received: from mai.imgcgcw.net ([2a01:e34:ed2f:f020:f437:29a8:ed69:7bab]) by smtp.gmail.com with ESMTPSA id z5sm17450497wrs.54.2019.10.11.23.53.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2019 23:53:03 -0700 (PDT) From: Daniel Lezcano To: rui.zhang@intel.com, edubezval@gmail.com Cc: daniel.lezcano@linaro.org, linux-kernel@vger.kernel.org, amit.kucheria@linaro.org Subject: [PATCH 03/11] thermal: Move internal IPA functions Date: Sat, 12 Oct 2019 08:52:47 +0200 Message-Id: <20191012065255.23249-3-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191012065255.23249-1-daniel.lezcano@linaro.org> References: <20191012065255.23249-1-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The exported IPA functions are used by the IPA. It is pointless to declare the functions in the thermal.h file. For better self-encapsulation and less impact for the compilation if a change is made on it. Move the code in the thermal core internal header file. As the users depends on THERMAL then it is pointless to have the stub, remove them. Take also the opportunity to fix checkpatch warnings/errors when moving the code around. Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_core.h | 13 +++++++++++++ include/linux/thermal.h | 24 ------------------------ 2 files changed, 13 insertions(+), 24 deletions(-) -- 2.17.1 diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h index 0e964240524d..5953bb527ec2 100644 --- a/drivers/thermal/thermal_core.h +++ b/drivers/thermal/thermal_core.h @@ -46,6 +46,19 @@ struct thermal_attr { char name[THERMAL_NAME_LENGTH]; }; +static inline bool cdev_is_power_actor(struct thermal_cooling_device *cdev) +{ + return cdev->ops->get_requested_power && cdev->ops->state2power && + cdev->ops->power2state; +} + +int power_actor_get_max_power(struct thermal_cooling_device *cdev, + struct thermal_zone_device *tz, u32 *max_power); +int power_actor_get_min_power(struct thermal_cooling_device *cdev, + struct thermal_zone_device *tz, u32 *min_power); +int power_actor_set_power(struct thermal_cooling_device *cdev, + struct thermal_instance *ti, u32 power); + /* * 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 603766a4068c..fae9ff2b079a 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -400,18 +400,6 @@ void devm_thermal_zone_of_sensor_unregister(struct device *dev, #endif #if IS_ENABLED(CONFIG_THERMAL) -static inline bool cdev_is_power_actor(struct thermal_cooling_device *cdev) -{ - return cdev->ops->get_requested_power && cdev->ops->state2power && - cdev->ops->power2state; -} - -int power_actor_get_max_power(struct thermal_cooling_device *, - struct thermal_zone_device *tz, u32 *max_power); -int power_actor_get_min_power(struct thermal_cooling_device *, - struct thermal_zone_device *tz, u32 *min_power); -int power_actor_set_power(struct thermal_cooling_device *, - struct thermal_instance *, u32); struct thermal_zone_device *thermal_zone_device_register(const char *, int, int, void *, struct thermal_zone_device_ops *, struct thermal_zone_params *, int, int); @@ -449,18 +437,6 @@ struct thermal_instance *get_thermal_instance(struct thermal_zone_device *, void thermal_cdev_update(struct thermal_cooling_device *); void thermal_notify_framework(struct thermal_zone_device *, int); #else -static inline bool cdev_is_power_actor(struct thermal_cooling_device *cdev) -{ return false; } -static inline int power_actor_get_max_power(struct thermal_cooling_device *cdev, - struct thermal_zone_device *tz, u32 *max_power) -{ return 0; } -static inline int power_actor_get_min_power(struct thermal_cooling_device *cdev, - struct thermal_zone_device *tz, - u32 *min_power) -{ return -ENODEV; } -static inline int power_actor_set_power(struct thermal_cooling_device *cdev, - struct thermal_instance *tz, u32 power) -{ return 0; } static inline struct thermal_zone_device *thermal_zone_device_register( const char *type, int trips, int mask, void *devdata, struct thermal_zone_device_ops *ops,