Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1301685ybb; Sat, 4 Apr 2020 00:31:56 -0700 (PDT) X-Google-Smtp-Source: APiQypKYs4ntf1zKPDQEfbUSjOelEcL7HTeqXeU6YmVrvU/tTjteFUSDadiqN/q6fKSSzew6bAO4 X-Received: by 2002:a4a:9cd8:: with SMTP id d24mr9952211ook.84.1585985516485; Sat, 04 Apr 2020 00:31:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585985516; cv=none; d=google.com; s=arc-20160816; b=tgyBZ78uKHHr44YL6qrK7MeFWypvPw/B3G5Uj7+2+e04qDQcDOrDhMi42iYWwNmZ57 6iBjarZzbL3YLPae+GKaI67tw7aKMS8LTxcZ66C8odeld+VWvtjssf5vWhHUUFcFIkub PK6k/O6E32gt9Vz1+yXmiWHRJGgy3JTxn6RHqSlufVwDtNLGpRTi49uiMUYv0LB2rf0l XBL4o2PgOaYZ9idT3ulubou4oiztDl9dazkf2WjTibHeJep5F85mdZAqEuc0GSmw9+qX bvOUtNaBC9RM8uEA+2UfPuUQ36qYPLK8mcPXjuHmVMoUsw56FT/vP8myze3RrVIIQ/o7 henw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=iN6wacGfdwib+ApYHKZ/FdwkNp4iLTwqPrmNMYd7r8E=; b=QFiSCHg8UTbPFqh9tBo7jUBJ1gh/N95V7+9+qqrcp0/iXImViGq/EFP2FH1ALnKljT oa5cYI861dCNE4GCvM/+dio8XUwxydwQz8zFJPs5P6+K1kxfqmNY9FhEblvGiw+cAuhk MR3JHoncfu/C6ZIMqExdEhKB2FcQuwSE5OemzRFqruJ8s7cP1dt9TqRDuNl5RixIZdec fexlYhoAWEyf1S6iM5u2J/x2E728MsRsuV8GmziL6j3ShGwKrAXMaN6P7BukC6zobzQE 5qVypiX+cR5GpXojVYMN/79OFJpc5GEAs9sLFkkmxUfXwJlxy9Fz9oojzjE2+kkDGXD5 ieHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verdurent-com.20150623.gappssmtp.com header.s=20150623 header.b=XgCyTbZn; 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 w28si5291570oth.317.2020.04.04.00.31.44; Sat, 04 Apr 2020 00:31:56 -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=@verdurent-com.20150623.gappssmtp.com header.s=20150623 header.b=XgCyTbZn; 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 S1726294AbgDDHbE (ORCPT + 99 others); Sat, 4 Apr 2020 03:31:04 -0400 Received: from mail-ua1-f65.google.com ([209.85.222.65]:36599 "EHLO mail-ua1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725837AbgDDHbD (ORCPT ); Sat, 4 Apr 2020 03:31:03 -0400 Received: by mail-ua1-f65.google.com with SMTP id m15so2875743uao.3 for ; Sat, 04 Apr 2020 00:31:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=verdurent-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iN6wacGfdwib+ApYHKZ/FdwkNp4iLTwqPrmNMYd7r8E=; b=XgCyTbZnWC345hsCKy5O82Uyugw36Ruw2EuDhzxddNPaJuxpWG/szVyMl3nKOsOQEw a6BCuJE2um28o68NDCtRThVKI9U4Z/+WRrs5jTdn0gjMLnJVWuNuO04Zq3VNqVjXz6O8 xzfXQSNFWneyDUxTm6J90kj5fxDYPWABFp8c46rQsUGTPUvU31Eb8JtyUPP2QnHUKFjS GoEgMZB4zvnj8RChQvLVjKbqBLgm/ja1Pw7rEp8FQ/CceQt+fzgjrZDbFDZT/cOXSXMT LF5uTx2yToS6x+iIPg6I0fNmVw9Oz6cLFMVbIHvgDltGByupCJFd39dk0GsGPBcxD+TS Lt8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iN6wacGfdwib+ApYHKZ/FdwkNp4iLTwqPrmNMYd7r8E=; b=BTPq5QYCJtB/dUyv6WVWjMkKOI4HNhm3IxCx0XK83+yT21eeSiekdIJryMobvHbCRD TTD//RC+Tgq3YJyGscUof9GmH2YuEhzvLg+QV2l7m7uK2B8ArC2a3PCHehSt3FzVTIa+ bhkBlQM7i3NDgOsVTi995HK/cSuNVCEilnVUdzXBBCeL7sfTZ7Whb4JtFemjzmkoVWIh homZs0dHGpUSblccn2pr0UXWMpph7AfrOvOF+3GO/dnen9Buln/NgjPZOOWvfIzw+Z9x SKBBMVCpVldLVnKJe32prcQbKX/D8UuRs6UnGAGhe/BSLBrnfas+AA05mLKJ8YFRx3gU tgBg== X-Gm-Message-State: AGi0PuYHnyMJBsWF44GmlXZK7bIqS1mN6K5JuGVNTk6Xt9InyoJ0AdPy i+h628zcXmXNxoe0tUHwuBCOx378QIEQoa6Ri+dMOw== X-Received: by 2002:ab0:5f90:: with SMTP id b16mr9274182uaj.77.1585985460113; Sat, 04 Apr 2020 00:31:00 -0700 (PDT) MIME-Version: 1.0 References: <20200402142747.8307-1-daniel.lezcano@linaro.org> <20200402142747.8307-3-daniel.lezcano@linaro.org> In-Reply-To: <20200402142747.8307-3-daniel.lezcano@linaro.org> From: Amit Kucheria Date: Sat, 4 Apr 2020 13:00:00 +0530 Message-ID: Subject: Re: [PATCH V2 3/9] thermal: Move internal IPA functions To: Daniel Lezcano Cc: Zhang Rui , "open list:THERMAL" , open list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 2, 2020 at 7:58 PM Daniel Lezcano wrote: > > 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 Reviewed-by: Amit Kucheria > --- > drivers/thermal/thermal_core.h | 13 +++++++++++++ > include/linux/thermal.h | 24 ------------------------ > 2 files changed, 13 insertions(+), 24 deletions(-) > > diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h > index 5d08ad60d9df..f99551ce9838 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 5aa80fb2fb61..e0279f7b43f4 100644 > --- a/include/linux/thermal.h > +++ b/include/linux/thermal.h > @@ -399,18 +399,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); > @@ -447,18 +435,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, > -- > 2.17.1 >