Re: [PATCH] pinctrl: bcm63268: Add gpio function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Kyle,

kernel test robot noticed the following build warnings:

[auto build test WARNING on linusw-pinctrl/devel]
[also build test WARNING on linusw-pinctrl/for-next linus/master v6.13-rc1 next-20241206]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Kyle-Hendry/pinctrl-bcm63268-Add-gpio-function/20241208-063718
base:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git devel
patch link:    https://lore.kernel.org/r/20241207223335.17535-1-kylehendrydev%40gmail.com
patch subject: [PATCH] pinctrl: bcm63268: Add gpio function
config: x86_64-buildonly-randconfig-005-20241208 (https://download.01.org/0day-ci/archive/20241208/202412081215.VyJuftPL-lkp@xxxxxxxxx/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241208/202412081215.VyJuftPL-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412081215.VyJuftPL-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> drivers/pinctrl/bcm/pinctrl-bcm63268.c:630:7: warning: variable 'reg' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
     630 |         case BCM63268_NOREG:
         |              ^~~~~~~~~~~~~~
   drivers/pinctrl/bcm/pinctrl-bcm63268.c:638:31: note: uninitialized use occurs here
     638 |         regmap_update_bits(pc->regs, reg, mask, val);
         |                                      ^~~
   drivers/pinctrl/bcm/pinctrl-bcm63268.c:603:18: note: initialize the variable 'reg' to silence this warning
     603 |         unsigned int reg;
         |                         ^
         |                          = 0
>> drivers/pinctrl/bcm/pinctrl-bcm63268.c:630:7: warning: variable 'mask' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
     630 |         case BCM63268_NOREG:
         |              ^~~~~~~~~~~~~~
   drivers/pinctrl/bcm/pinctrl-bcm63268.c:638:36: note: uninitialized use occurs here
     638 |         regmap_update_bits(pc->regs, reg, mask, val);
         |                                           ^~~~
   drivers/pinctrl/bcm/pinctrl-bcm63268.c:604:24: note: initialize the variable 'mask' to silence this warning
     604 |         unsigned int val, mask;
         |                               ^
         |                                = 0
>> drivers/pinctrl/bcm/pinctrl-bcm63268.c:630:7: warning: variable 'val' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
     630 |         case BCM63268_NOREG:
         |              ^~~~~~~~~~~~~~
   drivers/pinctrl/bcm/pinctrl-bcm63268.c:638:42: note: uninitialized use occurs here
     638 |         regmap_update_bits(pc->regs, reg, mask, val);
         |                                                 ^~~
   drivers/pinctrl/bcm/pinctrl-bcm63268.c:604:18: note: initialize the variable 'val' to silence this warning
     604 |         unsigned int val, mask;
         |                         ^
         |                          = 0
   3 warnings generated.


vim +/reg +630 drivers/pinctrl/bcm/pinctrl-bcm63268.c

   595	
   596	static int bcm63268_pinctrl_set_mux(struct pinctrl_dev *pctldev,
   597					    unsigned selector, unsigned group)
   598	{
   599		struct bcm63xx_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev);
   600		const struct pingroup *pg = &bcm63268_groups[group];
   601		const struct bcm63268_function *f = &bcm63268_funcs[selector];
   602		unsigned i;
   603		unsigned int reg;
   604		unsigned int val, mask;
   605	
   606		for (i = 0; i < pg->npins; i++)
   607			bcm63268_set_gpio(pc, pg->pins[i]);
   608	
   609		switch (f->reg) {
   610		case BCM63268_LEDCTRL:
   611			reg = BCM63268_LED_REG;
   612			mask = BIT(pg->pins[0]);
   613			val = BIT(pg->pins[0]);
   614			break;
   615		case BCM63268_MODE:
   616			reg = BCM63268_MODE_REG;
   617			mask = BIT(pg->pins[0]);
   618			val = BIT(pg->pins[0]);
   619			break;
   620		case BCM63268_CTRL:
   621			reg = BCM63268_CTRL_REG;
   622			mask = BIT(pg->pins[0]);
   623			val = 0;
   624			break;
   625		case BCM63268_BASEMODE:
   626			reg = BCM63268_BASEMODE_REG;
   627			mask = f->mask;
   628			val = f->mask;
   629			break;
 > 630		case BCM63268_NOREG:
   631			/*Do nothing, leave registers as default*/
   632			break;
   633		default:
   634			WARN_ON(1);
   635			return -EINVAL;
   636		}
   637	
   638		regmap_update_bits(pc->regs, reg, mask, val);
   639	
   640		return 0;
   641	}
   642	

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




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux