Linux Power Management development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: viresh.kumar@linaro.org
Cc: linux-pm@vger.kernel.org
Subject: [bug report] opp: Remove bandwidth votes when target_freq is zero
Date: Fri, 29 May 2020 11:41:53 +0300	[thread overview]
Message-ID: <20200529084153.GA1298732@mwanda> (raw)

Hello Viresh Kumar,

The patch c57afacc9270: "opp: Remove bandwidth votes when target_freq
is zero" from May 27, 2020, leads to the following static checker
warning:

	drivers/opp/core.c:875 dev_pm_opp_set_rate()
	error: uninitialized symbol 'opp'.

drivers/opp/core.c
   844   */
   845  int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
   846  {
   847          struct opp_table *opp_table;
   848          unsigned long freq, old_freq, temp_freq;
   849          struct dev_pm_opp *old_opp, *opp;
                                             ^^^

   850          struct clk *clk;
   851          int ret;
   852  
   853          opp_table = _find_opp_table(dev);
   854          if (IS_ERR(opp_table)) {
   855                  dev_err(dev, "%s: device opp doesn't exist\n", __func__);
   856                  return PTR_ERR(opp_table);
   857          }
   858  
   859          if (unlikely(!target_freq)) {
   860                  /*
   861                   * Some drivers need to support cases where some platforms may
   862                   * have OPP table for the device, while others don't and
   863                   * opp_set_rate() just needs to behave like clk_set_rate().
   864                   */
   865                  if (!_get_opp_count(opp_table))
   866                          return 0;
   867  
   868                  if (!opp_table->required_opp_tables && !opp_table->regulators &&
   869                      !opp_table->paths) {
   870                          dev_err(dev, "target frequency can't be 0\n");
   871                          ret = -EINVAL;
   872                          goto put_opp_table;
   873                  }
   874  
   875                  ret = _set_opp_bw(opp_table, opp, dev, true);
                                                     ^^^
Not initialized.

   876                  if (ret)
   877                          return ret;
   878  
   879                  if (opp_table->regulator_enabled) {
   880                          regulator_disable(opp_table->regulators[0]);
   881                          opp_table->regulator_enabled = false;
   882                  }

regards,
dan carpenter

             reply	other threads:[~2020-05-29  8:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-29  8:41 Dan Carpenter [this message]
2020-05-29  8:53 ` [bug report] opp: Remove bandwidth votes when target_freq is zero 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=20200529084153.GA1298732@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-pm@vger.kernel.org \
    --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