All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Frank Wunderlich <frank-w@public-files.de>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [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
Date: Mon, 28 Oct 2024 19:08:15 +0800	[thread overview]
Message-ID: <202410281900.W3HLtP1B-lkp@intel.com> (raw)

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

                 reply	other threads:[~2024-10-28 11:08 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=202410281900.W3HLtP1B-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=frank-w@public-files.de \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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.