mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Rafael Wysocki <rjw@rjwysocki.net>,
	nm@ti.com, linaro-kernel@lists.linaro.org,
	linux-pm@vger.kernel.org, khilman@linaro.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Len Brown <len.brown@intel.com>,
	open list <linux-kernel@vger.kernel.org>,
	Pavel Machek <pavel@ucw.cz>
Subject: Re: [PATCH 2/6] PM / OPP: restructure _of_init_opp_table_v2()
Date: Mon, 10 Aug 2015 12:23:37 -0700	[thread overview]
Message-ID: <20150810192336.GC9678@codeaurora.org> (raw)
In-Reply-To: <804c420eb23e70448c3c2c93f867a0eab3536bfd.1439187821.git.viresh.kumar@linaro.org>

On 08/10, Viresh Kumar wrote:
> 'dev_opp' will always be NULL in _of_init_opp_table_v2() after creating
> OPPs for a device. There is no point comparing it against NULL there.
> 
> Restructure code a bit to make it more efficient.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

Curious if these are a response to the static checker mails? If
so it would be good to add a reported-by tag.

> ---
>  drivers/base/power/opp.c | 21 ++++++++++-----------
>  1 file changed, 10 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
> index 1daaa1a418a2..c9747fb192b1 100644
> --- a/drivers/base/power/opp.c
> +++ b/drivers/base/power/opp.c
> @@ -1295,20 +1295,19 @@ static int _of_init_opp_table_v2(struct device *dev,
>  	if (WARN_ON(!count))
>  		goto out;
>  
> -	if (!ret) {
> -		if (!dev_opp) {
> -			dev_opp = _find_device_opp(dev);
> -			if (WARN_ON(!dev_opp))
> -				goto out;
> -		}
> -
> -		dev_opp->np = opp_np;
> -		dev_opp->shared_opp = of_property_read_bool(opp_np,
> -							    "opp-shared");
> -	} else {
> +	if (ret) {
>  		of_free_opp_table(dev);
> +		goto out;
>  	}
>  
> +	dev_opp = _find_device_opp(dev);
> +	if (WARN_ON(!dev_opp))
> +		goto out;

Doesn't ret = 0 in this case? Why not drop the goto and just
return some error code. Same for the goto out up above.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

  reply	other threads:[~2015-08-10 19:23 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1439187821.git.viresh.kumar@linaro.org>
2015-08-10  6:31 ` [PATCH 1/6] PM / OPP: reuse of_parse_phandle() Viresh Kumar
2015-08-11  6:02   ` Stephen Boyd
2015-08-11  6:10     ` Viresh Kumar
2015-08-11  6:23       ` Stephen Boyd
2015-08-11  6:42         ` Viresh Kumar
2015-08-10  6:31 ` [PATCH 2/6] PM / OPP: restructure _of_init_opp_table_v2() Viresh Kumar
2015-08-10 19:23   ` Stephen Boyd [this message]
2015-08-11  0:23     ` Viresh Kumar
2015-08-11  0:31       ` Stephen Boyd
2015-08-11  2:25         ` Viresh Kumar
2015-08-11  6:08           ` Stephen Boyd
2015-08-11  6:57             ` Viresh Kumar
2015-08-11  8:37               ` Viresh Kumar
2015-08-11  2:33         ` Viresh Kumar
2015-08-11  6:09           ` Stephen Boyd
2015-08-10  6:31 ` [PATCH 3/6] PM / OPP: Prefix exported opp routines with dev_pm_opp_ Viresh Kumar
2015-08-10 19:24   ` Stephen Boyd
2015-08-10  6:32 ` [PATCH 4/6] PM / OPP: Move opp core to its own directory Viresh Kumar
2015-08-10 19:51   ` Stephen Boyd
2015-08-11  0:25     ` Viresh Kumar
2015-08-10  6:32 ` [PATCH 5/6] PM / OPP: Move cpu specific code to opp/cpu.c Viresh Kumar
2015-08-11  6:09   ` Stephen Boyd
2015-08-10  6:32 ` [PATCH 6/6] PM / OPP: Add debugfs support Viresh Kumar
2015-08-10 19:50   ` Stephen Boyd
2015-08-11  6:35     ` Viresh Kumar
2015-08-11  6:37     ` Viresh Kumar

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=20150810192336.GC9678@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=khilman@linaro.org \
    --cc=len.brown@intel.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    --cc=viresh.kumar@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome