All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: drivers/opp/core.c:1742:50: warning: Uninitialized variables: opp.node, opp.kref, opp.available, opp.dynamic, opp.turbo, opp.suspend, opp.removed, opp.pstate, opp.rates, opp.level, opp.supplies, opp.bandwidth, opp.clock_latency_ns, opp.required_opps, opp....
Date: Wed, 10 Aug 2022 08:32:54 +0800	[thread overview]
Message-ID: <202208100834.32YuEOLO-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 10486 bytes --]

:::::: 
:::::: Manual check reason: "low confidence static check warning: drivers/opp/core.c:1742:50: warning: Uninitialized variables: opp.node, opp.kref, opp.available, opp.dynamic, opp.turbo, opp.suspend, opp.removed, opp.pstate, opp.rates, opp.level, opp.supplies, opp.bandwidth, opp.clock_latency_ns, opp.required_opps, opp.opp_table, opp.np [uninitvar]"
:::::: 

BCC: lkp(a)intel.com
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Viresh Kumar <viresh.kumar@linaro.org>
CC: Krzysztof Kozlowski <krzk@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   15205c2829ca2cbb5ece5ceaafe1171a8470e62b
commit: 2083da24eb56ce622332946800a67a7449d85fe5 OPP: Allow multiple clocks for a device
date:   4 weeks ago
:::::: branch date: 7 hours ago
:::::: commit date: 4 weeks ago
compiler: sparc64-linux-gcc (GCC) 12.1.0
reproduce (cppcheck warning):
        # apt-get install cppcheck
        git checkout 2083da24eb56ce622332946800a67a7449d85fe5
        cppcheck --quiet --enable=style,performance,portability --template=gcc FILE

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>


cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

   drivers/opp/core.c:818:23: warning: Parameter 'regulators' can be declared with const [constParameter]
      struct regulator **regulators, unsigned int count)
                         ^
   drivers/opp/core.c:2542:27: warning: Parameter 'src_opp' can be declared with const [constParameter]
          struct dev_pm_opp *src_opp)
                             ^
   drivers/opp/core.c:64:26: warning: Uninitialized variables: opp_table.node, opp_table.lazy, opp_table.head, opp_table.dev_list, opp_table.opp_list, opp_table.kref, opp_table.lock, opp_table.np, opp_table.clock_latency_ns_max, opp_table.voltage_tolerance_v1, opp_table.parsed_static_opps, opp_table.shared_opp, opp_table.rate_clk_single, opp_table.current_opp, opp_table.suspend_opp, opp_table.genpd_virt_dev_lock, opp_table.genpd_virt_devs, opp_table.required_opp_tables, opp_table.required_opp_count, opp_table.supported_hw, opp_table.supported_hw_count, opp_table.prop_name, opp_table.config_clks, opp_table.clks, opp_table.clk, opp_table.clk_count, opp_table.config_regulators, opp_table.regulators, opp_table.regulator_count, opp_table.paths, opp_table.path_count, opp_table.enabled, opp_table.genpd_performance_state, opp_table.is_genpd [uninitvar]
     if (_find_opp_dev(dev, opp_table)) {
                            ^
   drivers/opp/core.c:394:12: warning: Uninitialized variable: opp->available [uninitvar]
     if (opp->available)
              ^
   drivers/opp/core.c:491:17: warning: Uninitialized variable: temp_opp->available [uninitvar]
     if (temp_opp->available == available) {
                   ^
   drivers/opp/core.c:1527:13: warning: Uninitialized variable: iter->rates [uninitvar]
     if (iter->rates[0] == freq) {
               ^
   drivers/opp/core.c:1521:12: note: Assuming condition is false
    if (IS_ERR(opp_table))
              ^
   drivers/opp/core.c:1527:13: note: Uninitialized variable: iter->rates
     if (iter->rates[0] == freq) {
               ^
   drivers/opp/core.c:1561:14: warning: Uninitialized variable: temp->removed [uninitvar]
     if (!temp->removed && dynamic == temp->dynamic) {
                ^
>> drivers/opp/core.c:1742:50: warning: Uninitialized variables: opp.node, opp.kref, opp.available, opp.dynamic, opp.turbo, opp.suspend, opp.removed, opp.pstate, opp.rates, opp.level, opp.supplies, opp.bandwidth, opp.clock_latency_ns, opp.required_opps, opp.opp_table, opp.np [uninitvar]
     opp_cmp = _opp_compare_key(opp_table, new_opp, opp);
                                                    ^
   drivers/opp/core.c:2714:16: warning: Uninitialized variable: tmp_opp->rates [uninitvar]
     if (tmp_opp->rates[0] == freq) {
                  ^
   drivers/opp/core.c:2704:12: note: Assuming condition is false
    if (IS_ERR(opp_table)) {
              ^
   drivers/opp/core.c:2714:16: note: Uninitialized variable: tmp_opp->rates
     if (tmp_opp->rates[0] == freq) {
                  ^
   drivers/opp/core.c:2785:16: warning: Uninitialized variable: tmp_opp->rates [uninitvar]
     if (tmp_opp->rates[0] == freq) {
                  ^
   drivers/opp/core.c:2775:12: note: Assuming condition is false
    if (IS_ERR(opp_table)) {
              ^
   drivers/opp/core.c:2785:16: note: Uninitialized variable: tmp_opp->rates
     if (tmp_opp->rates[0] == freq) {
                  ^
   drivers/opp/core.c:64:26: warning: Uninitialized variables: opp_table.node, opp_table.lazy, opp_table.head, opp_table.dev_list, opp_table.opp_list, opp_table.kref, opp_table.lock, opp_table.np, opp_table.clock_latency_ns_max, opp_table.voltage_tolerance_v1, opp_table.parsed_static_opps, opp_table.shared_opp, opp_table.rate_clk_single, opp_table.current_opp, opp_table.suspend_opp, opp_table.genpd_virt_dev_lock, opp_table.genpd_virt_devs, opp_table.required_opp_tables, opp_table.required_opp_count, opp_table.supported_hw, opp_table.supported_hw_count, opp_table.prop_name, opp_table.config_clks, opp_table.clks, opp_table.clk, opp_table.clk_count, opp_table.config_regulators, opp_table.regulators, opp_table.regulator_count, opp_table.paths, opp_table.path_count, opp_table.enabled, opp_table.genpd_performance_state, opp_table.is_genpd, opp_table.dentry [uninitvar]
     if (_find_opp_dev(dev, opp_table)) {
                            ^
   drivers/opp/core.c:1742:50: warning: Uninitialized variables: opp.node, opp.kref, opp.available, opp.dynamic, opp.turbo, opp.suspend, opp.removed, opp.pstate, opp.rates, opp.level, opp.supplies, opp.bandwidth, opp.clock_latency_ns, opp.required_opps, opp.opp_table, opp.np, opp.dentry, opp.of_name [uninitvar]
     opp_cmp = _opp_compare_key(opp_table, new_opp, opp);
                                                    ^

vim +1742 drivers/opp/core.c

6c591eec67cbb4 drivers/opp/core.c            Saravana Kannan 2020-05-12  1725  
a1e8c13600bfd9 drivers/opp/core.c            Viresh Kumar    2018-04-06  1726  static int _opp_is_duplicate(struct device *dev, struct dev_pm_opp *new_opp,
a1e8c13600bfd9 drivers/opp/core.c            Viresh Kumar    2018-04-06  1727  			     struct opp_table *opp_table,
a1e8c13600bfd9 drivers/opp/core.c            Viresh Kumar    2018-04-06  1728  			     struct list_head **head)
23dacf6d2e9935 drivers/base/power/opp.c      Viresh Kumar    2015-07-29  1729  {
23dacf6d2e9935 drivers/base/power/opp.c      Viresh Kumar    2015-07-29  1730  	struct dev_pm_opp *opp;
6c591eec67cbb4 drivers/opp/core.c            Saravana Kannan 2020-05-12  1731  	int opp_cmp;
23dacf6d2e9935 drivers/base/power/opp.c      Viresh Kumar    2015-07-29  1732  
23dacf6d2e9935 drivers/base/power/opp.c      Viresh Kumar    2015-07-29  1733  	/*
23dacf6d2e9935 drivers/base/power/opp.c      Viresh Kumar    2015-07-29  1734  	 * Insert new OPP in order of increasing frequency and discard if
23dacf6d2e9935 drivers/base/power/opp.c      Viresh Kumar    2015-07-29  1735  	 * already present.
23dacf6d2e9935 drivers/base/power/opp.c      Viresh Kumar    2015-07-29  1736  	 *
2c2709dc6921c5 drivers/base/power/opp/core.c Viresh Kumar    2016-02-16  1737  	 * Need to use &opp_table->opp_list in the condition part of the 'for'
23dacf6d2e9935 drivers/base/power/opp.c      Viresh Kumar    2015-07-29  1738  	 * loop, don't replace it with head otherwise it will become an infinite
23dacf6d2e9935 drivers/base/power/opp.c      Viresh Kumar    2015-07-29  1739  	 * loop.
23dacf6d2e9935 drivers/base/power/opp.c      Viresh Kumar    2015-07-29  1740  	 */
052c6f19141dd1 drivers/base/power/opp/core.c Viresh Kumar    2017-01-23  1741  	list_for_each_entry(opp, &opp_table->opp_list, node) {
2083da24eb56ce drivers/opp/core.c            Viresh Kumar    2022-06-10 @1742  		opp_cmp = _opp_compare_key(opp_table, new_opp, opp);
6c591eec67cbb4 drivers/opp/core.c            Saravana Kannan 2020-05-12  1743  		if (opp_cmp > 0) {
a1e8c13600bfd9 drivers/opp/core.c            Viresh Kumar    2018-04-06  1744  			*head = &opp->node;
23dacf6d2e9935 drivers/base/power/opp.c      Viresh Kumar    2015-07-29  1745  			continue;
23dacf6d2e9935 drivers/base/power/opp.c      Viresh Kumar    2015-07-29  1746  		}
23dacf6d2e9935 drivers/base/power/opp.c      Viresh Kumar    2015-07-29  1747  
6c591eec67cbb4 drivers/opp/core.c            Saravana Kannan 2020-05-12  1748  		if (opp_cmp < 0)
a1e8c13600bfd9 drivers/opp/core.c            Viresh Kumar    2018-04-06  1749  			return 0;
23dacf6d2e9935 drivers/base/power/opp.c      Viresh Kumar    2015-07-29  1750  
23dacf6d2e9935 drivers/base/power/opp.c      Viresh Kumar    2015-07-29  1751  		/* Duplicate OPPs */
064416586190cb drivers/base/power/opp.c      Viresh Kumar    2015-07-29  1752  		dev_warn(dev, "%s: duplicate OPPs detected. Existing: freq: %lu, volt: %lu, enabled: %d. New: freq: %lu, volt: %lu, enabled: %d\n",
2083da24eb56ce drivers/opp/core.c            Viresh Kumar    2022-06-10  1753  			 __func__, opp->rates[0], opp->supplies[0].u_volt,
2083da24eb56ce drivers/opp/core.c            Viresh Kumar    2022-06-10  1754  			 opp->available, new_opp->rates[0],
dfbe4678d709e2 drivers/base/power/opp/core.c Viresh Kumar    2016-12-01  1755  			 new_opp->supplies[0].u_volt, new_opp->available);
23dacf6d2e9935 drivers/base/power/opp.c      Viresh Kumar    2015-07-29  1756  
dfbe4678d709e2 drivers/base/power/opp/core.c Viresh Kumar    2016-12-01  1757  		/* Should we compare voltages for all regulators here ? */
a1e8c13600bfd9 drivers/opp/core.c            Viresh Kumar    2018-04-06  1758  		return opp->available &&
7f8538ebaefc07 drivers/base/power/opp/core.c Viresh Kumar    2017-01-02  1759  		       new_opp->supplies[0].u_volt == opp->supplies[0].u_volt ? -EBUSY : -EEXIST;
a1e8c13600bfd9 drivers/opp/core.c            Viresh Kumar    2018-04-06  1760  	}
a1e8c13600bfd9 drivers/opp/core.c            Viresh Kumar    2018-04-06  1761  
a1e8c13600bfd9 drivers/opp/core.c            Viresh Kumar    2018-04-06  1762  	return 0;
a1e8c13600bfd9 drivers/opp/core.c            Viresh Kumar    2018-04-06  1763  }
a1e8c13600bfd9 drivers/opp/core.c            Viresh Kumar    2018-04-06  1764  

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

                 reply	other threads:[~2022-08-10  0:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202208100834.32YuEOLO-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.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.