llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org
Subject: [mingo-tip:sched/headers 2061/2356] drivers/pinctrl/pinctrl-microchip-sgpio.c:656:39: warning: variable 'flags' is uninitialized when used here
Date: Tue, 19 Apr 2022 10:23:51 +0800	[thread overview]
Message-ID: <202204191041.XKFMSrNr-lkp@intel.com> (raw)

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git sched/headers
head:   af93551cf39027d176f30b9beafc60a4c130998a
commit: abac2ae0fd81750ce0835c0637b6b7fff7c2316a [2061/2356] headers/deps: irq: Optimize <linux/irq.h> dependencies
config: i386-randconfig-a012-20220418 (https://download.01.org/0day-ci/archive/20220419/202204191041.XKFMSrNr-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 429cbac0390654f90bba18a41799464adf31a5ec)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git/commit/?id=abac2ae0fd81750ce0835c0637b6b7fff7c2316a
        git remote add mingo-tip git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git
        git fetch --no-tags mingo-tip sched/headers
        git checkout abac2ae0fd81750ce0835c0637b6b7fff7c2316a
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/gpu/drm/panel/ drivers/hwmon/ drivers/iio/afe/ drivers/iio/proximity/ drivers/input/touchscreen/ drivers/mtd/nand/ drivers/phy/cadence/ drivers/pinctrl/ drivers/platform/chrome/ mm/

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

All warnings (new ones prefixed by >>):

   drivers/pinctrl/pinctrl-microchip-sgpio.c:656:2: error: implicit declaration of function 'spin_lock_irqsave' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
           spin_lock_irqsave(&bank->priv->lock, flags);
           ^
   drivers/pinctrl/pinctrl-microchip-sgpio.c:675:2: error: implicit declaration of function 'spin_unlock_irqrestore' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
           spin_unlock_irqrestore(&bank->priv->lock, flags);
           ^
   drivers/pinctrl/pinctrl-microchip-sgpio.c:675:2: note: did you mean 'spin_lock_irqsave'?
   drivers/pinctrl/pinctrl-microchip-sgpio.c:656:2: note: 'spin_lock_irqsave' declared here
           spin_lock_irqsave(&bank->priv->lock, flags);
           ^
>> drivers/pinctrl/pinctrl-microchip-sgpio.c:656:39: warning: variable 'flags' is uninitialized when used here [-Wuninitialized]
           spin_lock_irqsave(&bank->priv->lock, flags);
                                                ^~~~~
   drivers/pinctrl/pinctrl-microchip-sgpio.c:651:21: note: initialize the variable 'flags' to silence this warning
           unsigned long flags;
                              ^
                               = 0
   1 warning and 2 errors generated.


vim +/flags +656 drivers/pinctrl/pinctrl-microchip-sgpio.c

7e5ea974e61c8d Lars Povlsen  2020-11-13  642  
be2dc859abd4d7 Lars Povlsen  2020-12-09  643  static void microchip_sgpio_irq_settype(struct irq_data *data,
be2dc859abd4d7 Lars Povlsen  2020-12-09  644  					int type,
be2dc859abd4d7 Lars Povlsen  2020-12-09  645  					int polarity)
be2dc859abd4d7 Lars Povlsen  2020-12-09  646  {
be2dc859abd4d7 Lars Povlsen  2020-12-09  647  	struct gpio_chip *chip = irq_data_get_irq_chip_data(data);
be2dc859abd4d7 Lars Povlsen  2020-12-09  648  	struct sgpio_bank *bank = gpiochip_get_data(chip);
be2dc859abd4d7 Lars Povlsen  2020-12-09  649  	unsigned int gpio = irqd_to_hwirq(data);
be2dc859abd4d7 Lars Povlsen  2020-12-09  650  	struct sgpio_port_addr addr;
7996c5f5ec7a20 Michael Walle 2022-02-26  651  	unsigned long flags;
be2dc859abd4d7 Lars Povlsen  2020-12-09  652  	u32 ena;
be2dc859abd4d7 Lars Povlsen  2020-12-09  653  
be2dc859abd4d7 Lars Povlsen  2020-12-09  654  	sgpio_pin_to_addr(bank->priv, gpio, &addr);
be2dc859abd4d7 Lars Povlsen  2020-12-09  655  
7996c5f5ec7a20 Michael Walle 2022-02-26 @656  	spin_lock_irqsave(&bank->priv->lock, flags);
7996c5f5ec7a20 Michael Walle 2022-02-26  657  
be2dc859abd4d7 Lars Povlsen  2020-12-09  658  	/* Disable interrupt while changing type */
be2dc859abd4d7 Lars Povlsen  2020-12-09  659  	ena = sgpio_readl(bank->priv, REG_INT_ENABLE, addr.bit);
be2dc859abd4d7 Lars Povlsen  2020-12-09  660  	sgpio_writel(bank->priv, ena & ~BIT(addr.port), REG_INT_ENABLE, addr.bit);
be2dc859abd4d7 Lars Povlsen  2020-12-09  661  
be2dc859abd4d7 Lars Povlsen  2020-12-09  662  	/* Type value spread over 2 registers sets: low, high bit */
be2dc859abd4d7 Lars Povlsen  2020-12-09  663  	sgpio_clrsetbits(bank->priv, REG_INT_TRIGGER, addr.bit,
be2dc859abd4d7 Lars Povlsen  2020-12-09  664  			 BIT(addr.port), (!!(type & 0x1)) << addr.port);
5d5f2919273d10 Lars Povlsen  2021-02-03  665  	sgpio_clrsetbits(bank->priv, REG_INT_TRIGGER, SGPIO_MAX_BITS + addr.bit,
be2dc859abd4d7 Lars Povlsen  2020-12-09  666  			 BIT(addr.port), (!!(type & 0x2)) << addr.port);
be2dc859abd4d7 Lars Povlsen  2020-12-09  667  
be2dc859abd4d7 Lars Povlsen  2020-12-09  668  	if (type == SGPIO_INT_TRG_LEVEL)
be2dc859abd4d7 Lars Povlsen  2020-12-09  669  		sgpio_clrsetbits(bank->priv, REG_INT_POLARITY, addr.bit,
be2dc859abd4d7 Lars Povlsen  2020-12-09  670  				 BIT(addr.port), polarity << addr.port);
be2dc859abd4d7 Lars Povlsen  2020-12-09  671  
be2dc859abd4d7 Lars Povlsen  2020-12-09  672  	/* Possibly re-enable interrupts */
be2dc859abd4d7 Lars Povlsen  2020-12-09  673  	sgpio_writel(bank->priv, ena, REG_INT_ENABLE, addr.bit);
7996c5f5ec7a20 Michael Walle 2022-02-26  674  
7996c5f5ec7a20 Michael Walle 2022-02-26 @675  	spin_unlock_irqrestore(&bank->priv->lock, flags);
be2dc859abd4d7 Lars Povlsen  2020-12-09  676  }
be2dc859abd4d7 Lars Povlsen  2020-12-09  677  

:::::: The code at line 656 was first introduced by commit
:::::: 7996c5f5ec7a20b3f6b8fae93fcf3cb8f1c01743 pinctrl: microchip-sgpio: lock RMW access

:::::: TO: Michael Walle <michael@walle.cc>
:::::: CC: Linus Walleij <linus.walleij@linaro.org>

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

                 reply	other threads:[~2022-04-19  2:24 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=202204191041.XKFMSrNr-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=mingo@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).