Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Sebastian Reichel <sebastian.reichel@collabora.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Vinod Koul <vkoul@kernel.org>, Kishon <kishon@ti.com>,
	Heiko Stuebner <heiko@sntech.de>,
	Zhang Yubing <yubing.zhang@rock-chips.com>,
	Frank Wang <frank.wang@rock-chips.com>
Subject: [phy:next 32/34] drivers/phy/rockchip/phy-rockchip-usbdp.c:1292:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true
Date: Sun, 14 Apr 2024 10:31:04 +0800	[thread overview]
Message-ID: <202404141048.qFAYDctQ-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy.git next
head:   a1fe1eca0d8be69ccc1f3d615e5a529df1c82e66
commit: 2f70bbddeb457580cef3ceb574506083b9272188 [32/34] phy: rockchip: add usbdp combo phy driver
config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20240414/202404141048.qFAYDctQ-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 8b3b4a92adee40483c27f26c478a384cd69c6f05)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240414/202404141048.qFAYDctQ-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202404141048.qFAYDctQ-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from drivers/phy/rockchip/phy-rockchip-usbdp.c:19:
   In file included from include/linux/phy/phy.h:17:
   In file included from include/linux/regulator/consumer.h:35:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:21:
   In file included from include/linux/mm.h:2208:
   include/linux/vmstat.h:508:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     508 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     509 |                            item];
         |                            ~~~~
   include/linux/vmstat.h:515:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     515 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     516 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     522 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   include/linux/vmstat.h:527:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     527 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     528 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:536:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     536 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     537 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
>> drivers/phy/rockchip/phy-rockchip-usbdp.c:1292:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
    1292 |         if (!(udphy->mode & UDPHY_MODE_USB) || udphy->hs) {
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/phy/rockchip/phy-rockchip-usbdp.c:1301:9: note: uninitialized use occurs here
    1301 |         return ret;
         |                ^~~
   drivers/phy/rockchip/phy-rockchip-usbdp.c:1292:2: note: remove the 'if' if its condition is always false
    1292 |         if (!(udphy->mode & UDPHY_MODE_USB) || udphy->hs) {
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1293 |                 rk_udphy_u3_port_disable(udphy, true);
         |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1294 |                 goto unlock;
         |                 ~~~~~~~~~~~~
    1295 |         }
         |         ~
>> drivers/phy/rockchip/phy-rockchip-usbdp.c:1292:6: warning: variable 'ret' is used uninitialized whenever '||' condition is true [-Wsometimes-uninitialized]
    1292 |         if (!(udphy->mode & UDPHY_MODE_USB) || udphy->hs) {
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/phy/rockchip/phy-rockchip-usbdp.c:1301:9: note: uninitialized use occurs here
    1301 |         return ret;
         |                ^~~
   drivers/phy/rockchip/phy-rockchip-usbdp.c:1292:6: note: remove the '||' if its condition is always false
    1292 |         if (!(udphy->mode & UDPHY_MODE_USB) || udphy->hs) {
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/phy/rockchip/phy-rockchip-usbdp.c:1288:9: note: initialize the variable 'ret' to silence this warning
    1288 |         int ret;
         |                ^
         |                 = 0
   7 warnings generated.


vim +1292 drivers/phy/rockchip/phy-rockchip-usbdp.c

  1284	
  1285	static int rk_udphy_usb3_phy_init(struct phy *phy)
  1286	{
  1287		struct rk_udphy *udphy = phy_get_drvdata(phy);
  1288		int ret;
  1289	
  1290		mutex_lock(&udphy->mutex);
  1291		/* DP only or high-speed, disable U3 port */
> 1292		if (!(udphy->mode & UDPHY_MODE_USB) || udphy->hs) {
  1293			rk_udphy_u3_port_disable(udphy, true);
  1294			goto unlock;
  1295		}
  1296	
  1297		ret = rk_udphy_power_on(udphy, UDPHY_MODE_USB);
  1298	
  1299	unlock:
  1300		mutex_unlock(&udphy->mutex);
  1301		return ret;
  1302	}
  1303	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

             reply	other threads:[~2024-04-14  2:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-14  2:31 kernel test robot [this message]
2024-04-14 16:05 ` [phy:next 32/34] drivers/phy/rockchip/phy-rockchip-usbdp.c:1292:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true Sebastian Reichel
2024-04-15  7:35   ` Vinod Koul
2024-04-15  9:02     ` Sebastian Reichel

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=202404141048.qFAYDctQ-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=frank.wang@rock-chips.com \
    --cc=heiko@sntech.de \
    --cc=kishon@ti.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=sebastian.reichel@collabora.com \
    --cc=vkoul@kernel.org \
    --cc=yubing.zhang@rock-chips.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