Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1642216 > unrolled thread

[PATCH] PM / Domains: pdd->dev can't be NULL in genpd_dev_pm_qos_notifier()

Started byViresh Kumar <viresh.kumar@linaro.org>
First post2017-05-16 07:30 +0200
Last post2017-05-16 08:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] PM / Domains: pdd->dev can't be NULL in genpd_dev_pm_qos_notifier() Viresh Kumar <viresh.kumar@linaro.org> - 2017-05-16 07:30 +0200
    Re: [PATCH] PM / Domains: pdd->dev can't be NULL in genpd_dev_pm_qos_notifier() Ulf Hansson <ulf.hansson@linaro.org> - 2017-05-16 08:50 +0200

#1642216 — [PATCH] PM / Domains: pdd->dev can't be NULL in genpd_dev_pm_qos_notifier()

FromViresh Kumar <viresh.kumar@linaro.org>
Date2017-05-16 07:30 +0200
Subject[PATCH] PM / Domains: pdd->dev can't be NULL in genpd_dev_pm_qos_notifier()
Message-ID<tHDdw-1qC-11@gated-at.bofh.it>
The pm_domain_data (pdd) pointer is set from genpd_alloc_dev_data() and
pdd->dev is guaranteed to be valid. There is no need to check pdd and
pdd->dev in rest of the code as pdd->dev will always be valid for a non
NULL pdd pointer.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/base/power/domain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index da49a8383dc3..71c95ad808d5 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -443,7 +443,7 @@ static int genpd_dev_pm_qos_notifier(struct notifier_block *nb,
 
 		pdd = dev->power.subsys_data ?
 				dev->power.subsys_data->domain_data : NULL;
-		if (pdd && pdd->dev) {
+		if (pdd) {
 			to_gpd_data(pdd)->td.constraint_changed = true;
 			genpd = dev_to_genpd(dev);
 		} else {
-- 
2.13.0.303.g4ebf3021692d

[toc] | [next] | [standalone]


#1642246

FromUlf Hansson <ulf.hansson@linaro.org>
Date2017-05-16 08:50 +0200
Message-ID<tHEsW-28N-5@gated-at.bofh.it>
In reply to#1642216
On 16 May 2017 at 07:22, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> The pm_domain_data (pdd) pointer is set from genpd_alloc_dev_data() and
> pdd->dev is guaranteed to be valid. There is no need to check pdd and
> pdd->dev in rest of the code as pdd->dev will always be valid for a non
> NULL pdd pointer.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe

> ---
>  drivers/base/power/domain.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index da49a8383dc3..71c95ad808d5 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -443,7 +443,7 @@ static int genpd_dev_pm_qos_notifier(struct notifier_block *nb,
>
>                 pdd = dev->power.subsys_data ?
>                                 dev->power.subsys_data->domain_data : NULL;
> -               if (pdd && pdd->dev) {
> +               if (pdd) {
>                         to_gpd_data(pdd)->td.constraint_changed = true;
>                         genpd = dev_to_genpd(dev);
>                 } else {
> --
> 2.13.0.303.g4ebf3021692d
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web