[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPDyKFpR6bwjUG_WtgvXJznBHcZBMOfTkj_Lb7aHPryvxC5mxQ@mail.gmail.com>
Date: Wed, 17 Apr 2019 10:38:14 +0200
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Yangtao Li <tiny.windzz@...il.com>
Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>,
Kevin Hilman <khilman@...nel.org>, Pavel Machek <pavel@....cz>,
Len Brown <len.brown@...el.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Linux PM <linux-pm@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] PM / Domains: remove unnecessary unlikely()
On Tue, 16 Apr 2019 at 18:23, Yangtao Li <tiny.windzz@...il.com> wrote:
>
> WARN_ON() already contains an unlikely(), so it's not necessary to use
> unlikely.
>
> Signed-off-by: Yangtao Li <tiny.windzz@...il.com>
Reviewed-by: Ulf Hansson <ulf.hansson@...aro.org>
Kind regards
Uffe
> ---
> drivers/base/power/domain.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index 96a6dc9d305c..598a4e02aee1 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -391,11 +391,9 @@ int dev_pm_genpd_set_performance_state(struct device *dev, unsigned int state)
> if (unlikely(!genpd->set_performance_state))
> return -EINVAL;
>
> - if (unlikely(!dev->power.subsys_data ||
> - !dev->power.subsys_data->domain_data)) {
> - WARN_ON(1);
> + if (WARN_ON(!dev->power.subsys_data ||
> + !dev->power.subsys_data->domain_data))
> return -EINVAL;
> - }
>
> genpd_lock(genpd);
>
> --
> 2.17.0
>
Powered by blists - more mailing lists