All of lore.kernel.org
 help / color / mirror / Atom feed
* [frank-w-bpi-r2-4.14:6.12-rsslro 62/70] drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c:614:11: warning: variable 'pd' is used uninitialized whenever 'if' condition is false
@ 2024-10-28 11:08 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-10-28 11:08 UTC (permalink / raw)
  To: Frank Wunderlich; +Cc: oe-kbuild-all

tree:   https://github.com/frank-w/BPI-R2-4.14 6.12-rsslro
head:   edb2a7a8be4be71a6502d19afd5b069f6d9fbacc
commit: de758cbe68d93ad88b262742e65efc2aa7490ecf [62/70] pinctrl: mediatek: add changes suggested by angelo
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20241028/202410281900.W3HLtP1B-lkp@intel.com/config)
compiler: clang version 19.1.2 (https://github.com/llvm/llvm-project 7ba7d8e2f7b6445b60679da826210cdde29eaf8b)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241028/202410281900.W3HLtP1B-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/202410281900.W3HLtP1B-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c:606:6: warning: unused variable 'err' [-Wunused-variable]
     606 |         int err, pd;
         |             ^~~
>> drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c:614:11: warning: variable 'pd' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
     614 |         else if (!pullup)
         |                  ^~~~~~~
   drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c:620:56: note: uninitialized use occurs here
     620 |         return mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PD, pd);
         |                                                               ^~
   drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c:614:7: note: remove the 'if' if its condition is always true
     614 |         else if (!pullup)
         |              ^~~~~~~~~~~~
     615 |                 pd = 1;
   drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c:606:13: note: initialize the variable 'pd' to silence this warning
     606 |         int err, pd;
         |                    ^
         |                     = 0
   drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c:602:12: warning: unused function 'mtk_pinconf_bias_set_pd' [-Wunused-function]
     602 | static int mtk_pinconf_bias_set_pd(struct mtk_pinctrl *hw,
         |            ^~~~~~~~~~~~~~~~~~~~~~~
   3 warnings generated.

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for MODVERSIONS
   Depends on [n]: MODULES [=y] && !COMPILE_TEST [=y]
   Selected by [y]:
   - RANDSTRUCT_FULL [=y] && (CC_HAS_RANDSTRUCT [=y] || GCC_PLUGINS [=n]) && MODULES [=y]


vim +614 drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c

   601	
   602	static int mtk_pinconf_bias_set_pd(struct mtk_pinctrl *hw,
   603					const struct mtk_pin_desc *desc,
   604					u32 pullup, u32 arg)
   605	{
   606		int err, pd;
   607	
   608		if (arg != MTK_DISABLE && arg != MTK_ENABLE)
   609			return -EINVAL;
   610	
   611		/* Either this */
   612		if (arg == MTK_DISABLE || pullup)
   613			pd = 0;
 > 614		else if (!pullup)
   615			pd = 1;
   616	
   617		/* Or this (but it's probably a bit too cryptic) */
   618		//pd = !(arg == MTK_DISABLE || pullup);
   619	
   620		return mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PD, pd);
   621	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-10-28 11:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-28 11:08 [frank-w-bpi-r2-4.14:6.12-rsslro 62/70] drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c:614:11: warning: variable 'pd' is used uninitialized whenever 'if' condition is false kernel test robot

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.