From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Ulf Hansson <ulf.hansson@linaro.org>, Yangtao Li <tiny.windzz@gmail.com>
Cc: Kevin Hilman <khilman@kernel.org>, Pavel Machek <pavel@ucw.cz>,
Len Brown <len.brown@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Linux PM <linux-pm@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] PM / Domains: remove unnecessary unlikely()
Date: Wed, 01 May 2019 12:24:29 +0200 [thread overview]
Message-ID: <4341173.rtllOHV0ML@kreacher> (raw)
In-Reply-To: <CAPDyKFpR6bwjUG_WtgvXJznBHcZBMOfTkj_Lb7aHPryvxC5mxQ@mail.gmail.com>
On Wednesday, April 17, 2019 10:38:14 AM CEST Ulf Hansson wrote:
> On Tue, 16 Apr 2019 at 18:23, Yangtao Li <tiny.windzz@gmail.com> wrote:
> >
> > WARN_ON() already contains an unlikely(), so it's not necessary to use
> > unlikely.
> >
> > Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
>
> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.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
> >
>
Patch applied, thanks!
prev parent reply other threads:[~2019-05-01 10:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-16 16:23 [PATCH] PM / Domains: remove unnecessary unlikely() Yangtao Li
2019-04-17 8:38 ` Ulf Hansson
2019-05-01 10:24 ` Rafael J. Wysocki [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4341173.rtllOHV0ML@kreacher \
--to=rjw@rjwysocki.net \
--cc=gregkh@linuxfoundation.org \
--cc=khilman@kernel.org \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=tiny.windzz@gmail.com \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.