public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Krzysztof Kozlowski <krzk@kernel.org>
Cc: lkp@intel.com, kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: [krzk-github:n/qcom-ufs-opp-v2 14/16] drivers/opp/core.c:1215 dev_pm_opp_set_rate() error: uninitialized symbol 'ret'.
Date: Fri, 15 Apr 2022 09:45:47 +0300	[thread overview]
Message-ID: <202204150900.qnJMf3Gu-lkp@intel.com> (raw)

tree:   https://github.com/krzk/linux n/qcom-ufs-opp-v2
head:   bf7d30c9329c87f06dff42b303a9bcfd2e1f54eb
commit: be46c855d54f763bfb95424e5204fe7496e2ee5f [14/16] PM: opp: allow control of multiple clocks
config: i386-randconfig-m021 (https://download.01.org/0day-ci/archive/20220415/202204150900.qnJMf3Gu-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.2.0-19) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
drivers/opp/core.c:1215 dev_pm_opp_set_rate() error: uninitialized symbol 'ret'.

Old smatch warnings:
drivers/opp/core.c:1197 dev_pm_opp_set_rate() warn: passing a valid pointer to 'PTR_ERR'
drivers/opp/core.c:2813 _opp_set_availability() warn: passing a valid pointer to 'PTR_ERR'
drivers/opp/core.c:2884 dev_pm_opp_adjust_voltage() warn: passing a valid pointer to 'PTR_ERR'

vim +/ret +1215 drivers/opp/core.c

386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1155  int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1156  {
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1157  	struct opp_table *opp_table;
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1158  	unsigned long freq = 0, temp_freq;
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1159  	struct dev_pm_opp *opp = NULL;
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1160  	int ret;
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1161  
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1162  	opp_table = _find_opp_table(dev);
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1163  	if (IS_ERR(opp_table)) {
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1164  		dev_err(dev, "%s: device's opp table doesn't exist\n", __func__);
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1165  		return PTR_ERR(opp_table);
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1166  	}
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1167  
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1168  	if (target_freq) {
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1169  		/*
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1170  		 * For IO devices which require an OPP on some platforms/SoCs
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1171  		 * while just needing to scale the clock on some others
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1172  		 * we look for empty OPP tables with just a clock handle and
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1173  		 * scale only the clk. This makes dev_pm_opp_set_rate()
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1174  		 * equivalent to a clk_set_rate()
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1175  		 */
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1176  		if (!_get_opp_count(opp_table)) {
be46c855d54f76 drivers/opp/core.c            Krzysztof Kozlowski 2022-04-05  1177  			if (opp_table->clks)
be46c855d54f76 drivers/opp/core.c            Krzysztof Kozlowski 2022-04-05  1178  				ret = _generic_set_opp_clk_only(dev,
be46c855d54f76 drivers/opp/core.c            Krzysztof Kozlowski 2022-04-05  1179  								opp_table->clks[0],
be46c855d54f76 drivers/opp/core.c            Krzysztof Kozlowski 2022-04-05  1180  								target_freq);

"ret" not initialized on else path.

386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1181  			goto put_opp_table;
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1182  		}
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1183  
be46c855d54f76 drivers/opp/core.c            Krzysztof Kozlowski 2022-04-05  1184  		if (opp_table->clks)
be46c855d54f76 drivers/opp/core.c            Krzysztof Kozlowski 2022-04-05  1185  			freq = clk_round_rate(opp_table->clks[0], target_freq);
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1186  		if ((long)freq <= 0)
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1187  			freq = target_freq;
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1188  
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1189  		/*
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1190  		 * The clock driver may support finer resolution of the
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1191  		 * frequencies than the OPP table, don't update the frequency we
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1192  		 * pass to clk_set_rate() here.
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1193  		 */
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1194  		temp_freq = freq;
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1195  		opp = _find_freq_ceil(opp_table, &temp_freq);
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1196  		if (IS_ERR(opp)) {
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1197  			ret = PTR_ERR(opp);
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1198  			dev_err(dev, "%s: failed to find OPP for freq %lu (%d)\n",
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1199  				__func__, freq, ret);
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1200  			goto put_opp_table;
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1201  		}
be46c855d54f76 drivers/opp/core.c            Krzysztof Kozlowski 2022-04-05  1202  		/*
be46c855d54f76 drivers/opp/core.c            Krzysztof Kozlowski 2022-04-05  1203  		 * opp->rates are used for scaling clocks, so be sure accurate
be46c855d54f76 drivers/opp/core.c            Krzysztof Kozlowski 2022-04-05  1204  		 * 'freq' is used, instead what was defined via e.g. Devicetree.
be46c855d54f76 drivers/opp/core.c            Krzysztof Kozlowski 2022-04-05  1205  		 */
be46c855d54f76 drivers/opp/core.c            Krzysztof Kozlowski 2022-04-05  1206  		opp->rates[0] = freq;
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1207  	}
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1208  
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1209  	ret = _set_opp(dev, opp_table, opp, freq);
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1210  
386ba854d9f316 drivers/opp/core.c            Viresh Kumar        2021-01-21  1211  	if (target_freq)
8a31d9d94297b1 drivers/base/power/opp/core.c Viresh Kumar        2017-01-23  1212  		dev_pm_opp_put(opp);
052c6f19141dd1 drivers/base/power/opp/core.c Viresh Kumar        2017-01-23  1213  put_opp_table:
5b650b388844f2 drivers/base/power/opp/core.c Viresh Kumar        2017-01-23  1214  	dev_pm_opp_put_opp_table(opp_table);
052c6f19141dd1 drivers/base/power/opp/core.c Viresh Kumar        2017-01-23 @1215  	return ret;
6a0712f6f199e7 drivers/base/power/opp/core.c Viresh Kumar        2016-02-09  1216  }

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp


             reply	other threads:[~2022-04-15  6:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-15  6:45 Dan Carpenter [this message]
2022-04-15  6:49 ` [krzk-github:n/qcom-ufs-opp-v2 14/16] drivers/opp/core.c:1215 dev_pm_opp_set_rate() error: uninitialized symbol 'ret' Dan Carpenter

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=202204150900.qnJMf3Gu-lkp@intel.com \
    --to=dan.carpenter@oracle.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    /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