public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [pinctrl-intel:review-andy 18/19] drivers/pinctrl/pinctrl-zynqmp.c:825:13: warning: variable 'pin' is uninitialized when used here
@ 2021-11-19  8:08 kernel test robot
  2021-11-19  8:33 ` Andy Shevchenko
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2021-11-19  8:08 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: llvm, kbuild-all, linux-kernel, Linus Walleij

[-- Attachment #1: Type: text/plain, Size: 3142 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel.git review-andy
head:   c25441ca551164c56b34885df3d657e2ea4d623f
commit: 9122cda6a325f80564f02b7899cc063009f5e1f9 [18/19] pinctrl: zynqmp: Unify pin naming
config: arm64-buildonly-randconfig-r004-20211118 (attached as .config)
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
        # install arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel.git/commit/?id=9122cda6a325f80564f02b7899cc063009f5e1f9
        git remote add pinctrl-intel https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel.git
        git fetch --no-tags pinctrl-intel review-andy
        git checkout 9122cda6a325f80564f02b7899cc063009f5e1f9
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm64 

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-zynqmp.c:825:13: warning: variable 'pin' is uninitialized when used here [-Wuninitialized]
           if (IS_ERR(pin->name))
                      ^~~
   drivers/pinctrl/pinctrl-zynqmp.c:811:37: note: initialize the variable 'pin' to silence this warning
           struct pinctrl_pin_desc *pins, *pin;
                                              ^
                                               = NULL
   1 warning generated.


vim +/pin +825 drivers/pinctrl/pinctrl-zynqmp.c

   794	
   795	/**
   796	 * zynqmp_pinctrl_prepare_pin_desc() - prepare pin description info
   797	 * @dev:		Device pointer.
   798	 * @zynqmp_pins:	Pin information.
   799	 * @npins:		Number of pins.
   800	 *
   801	 * Query number of pins information from firmware and prepare pin
   802	 * description containing pin number and pin name.
   803	 *
   804	 * Return: 0 on success else error code.
   805	 */
   806	static int zynqmp_pinctrl_prepare_pin_desc(struct device *dev,
   807						   const struct pinctrl_pin_desc
   808						   **zynqmp_pins,
   809						   unsigned int *npins)
   810	{
   811		struct pinctrl_pin_desc *pins, *pin;
   812		char **pin_names;
   813		int ret;
   814		int i;
   815	
   816		ret = zynqmp_pinctrl_get_num_pins(npins);
   817		if (ret)
   818			return ret;
   819	
   820		pins = devm_kzalloc(dev, sizeof(*pins) * *npins, GFP_KERNEL);
   821		if (!pins)
   822			return -ENOMEM;
   823	
   824		pin_names = devm_kasprintf_strarray(dev, ZYNQMP_PIN_PREFIX, *npins);
 > 825		if (IS_ERR(pin->name))
   826			return PTR_ERR(pin_names);
   827	
   828		for (i = 0; i < *npins; i++) {
   829			pin = &pins[i];
   830			pin->number = i;
   831			pin->name = pin_names[i];
   832		}
   833	
   834		*zynqmp_pins = pins;
   835	
   836		return 0;
   837	}
   838	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 45278 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [pinctrl-intel:review-andy 18/19] drivers/pinctrl/pinctrl-zynqmp.c:825:13: warning: variable 'pin' is uninitialized when used here
  2021-11-19  8:08 [pinctrl-intel:review-andy 18/19] drivers/pinctrl/pinctrl-zynqmp.c:825:13: warning: variable 'pin' is uninitialized when used here kernel test robot
@ 2021-11-19  8:33 ` Andy Shevchenko
  2021-11-19 17:20   ` Nathan Chancellor
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2021-11-19  8:33 UTC (permalink / raw)
  To: kernel test robot, Nathan Chancellor, Nick Desaulniers
  Cc: llvm, kbuild-all, linux-kernel, Linus Walleij

On Fri, Nov 19, 2021 at 04:08:32PM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel.git review-andy
> head:   c25441ca551164c56b34885df3d657e2ea4d623f
> commit: 9122cda6a325f80564f02b7899cc063009f5e1f9 [18/19] pinctrl: zynqmp: Unify pin naming
> config: arm64-buildonly-randconfig-r004-20211118 (attached as .config)
> 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
>         # install arm64 cross compiling tool for clang build
>         # apt-get install binutils-aarch64-linux-gnu
>         # https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel.git/commit/?id=9122cda6a325f80564f02b7899cc063009f5e1f9
>         git remote add pinctrl-intel https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel.git
>         git fetch --no-tags pinctrl-intel review-andy
>         git checkout 9122cda6a325f80564f02b7899cc063009f5e1f9
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm64 
> 
> 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-zynqmp.c:825:13: warning: variable 'pin' is uninitialized when used here [-Wuninitialized]
>            if (IS_ERR(pin->name))
>                       ^~~
>    drivers/pinctrl/pinctrl-zynqmp.c:811:37: note: initialize the variable 'pin' to silence this warning
>            struct pinctrl_pin_desc *pins, *pin;
>                                               ^
>                                                = NULL
>    1 warning generated.

Utterly inappropriate suggestion by the compiler (it found an actual error,
though).

Can be Clang fixed, really?

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [pinctrl-intel:review-andy 18/19] drivers/pinctrl/pinctrl-zynqmp.c:825:13: warning: variable 'pin' is uninitialized when used here
  2021-11-19  8:33 ` Andy Shevchenko
@ 2021-11-19 17:20   ` Nathan Chancellor
  2021-11-19 17:44     ` Andy Shevchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Nathan Chancellor @ 2021-11-19 17:20 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: kernel test robot, Nick Desaulniers, llvm, kbuild-all,
	linux-kernel, Linus Walleij

On Fri, Nov 19, 2021 at 10:33:36AM +0200, Andy Shevchenko wrote:
> On Fri, Nov 19, 2021 at 04:08:32PM +0800, kernel test robot wrote:
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel.git review-andy
> > head:   c25441ca551164c56b34885df3d657e2ea4d623f
> > commit: 9122cda6a325f80564f02b7899cc063009f5e1f9 [18/19] pinctrl: zynqmp: Unify pin naming
> > config: arm64-buildonly-randconfig-r004-20211118 (attached as .config)
> > 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
> >         # install arm64 cross compiling tool for clang build
> >         # apt-get install binutils-aarch64-linux-gnu
> >         # https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel.git/commit/?id=9122cda6a325f80564f02b7899cc063009f5e1f9
> >         git remote add pinctrl-intel https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel.git
> >         git fetch --no-tags pinctrl-intel review-andy
> >         git checkout 9122cda6a325f80564f02b7899cc063009f5e1f9
> >         # save the attached .config to linux build tree
> >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm64 
> > 
> > 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-zynqmp.c:825:13: warning: variable 'pin' is uninitialized when used here [-Wuninitialized]
> >            if (IS_ERR(pin->name))
> >                       ^~~
> >    drivers/pinctrl/pinctrl-zynqmp.c:811:37: note: initialize the variable 'pin' to silence this warning
> >            struct pinctrl_pin_desc *pins, *pin;
> >                                               ^
> >                                                = NULL
> >    1 warning generated.
> 
> Utterly inappropriate suggestion by the compiler (it found an actual error,
> though).
> 
> Can be Clang fixed, really?

I reported this upstream: https://bugs.llvm.org/show_bug.cgi?id=52559

Cheers,
Nathan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [pinctrl-intel:review-andy 18/19] drivers/pinctrl/pinctrl-zynqmp.c:825:13: warning: variable 'pin' is uninitialized when used here
  2021-11-19 17:20   ` Nathan Chancellor
@ 2021-11-19 17:44     ` Andy Shevchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2021-11-19 17:44 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: kernel test robot, Nick Desaulniers, llvm, kbuild-all,
	linux-kernel, Linus Walleij

On Fri, Nov 19, 2021 at 10:20:35AM -0700, Nathan Chancellor wrote:
> On Fri, Nov 19, 2021 at 10:33:36AM +0200, Andy Shevchenko wrote:
> > On Fri, Nov 19, 2021 at 04:08:32PM +0800, kernel test robot wrote:

...

> > > All warnings (new ones prefixed by >>):
> > > 
> > > >> drivers/pinctrl/pinctrl-zynqmp.c:825:13: warning: variable 'pin' is uninitialized when used here [-Wuninitialized]
> > >            if (IS_ERR(pin->name))
> > >                       ^~~
> > >    drivers/pinctrl/pinctrl-zynqmp.c:811:37: note: initialize the variable 'pin' to silence this warning
> > >            struct pinctrl_pin_desc *pins, *pin;
> > >                                               ^
> > >                                                = NULL
> > >    1 warning generated.
> > 
> > Utterly inappropriate suggestion by the compiler (it found an actual error,
> > though).
> > 
> > Can be Clang fixed, really?
> 
> I reported this upstream: https://bugs.llvm.org/show_bug.cgi?id=52559

Thanks!

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-19 17:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-19  8:08 [pinctrl-intel:review-andy 18/19] drivers/pinctrl/pinctrl-zynqmp.c:825:13: warning: variable 'pin' is uninitialized when used here kernel test robot
2021-11-19  8:33 ` Andy Shevchenko
2021-11-19 17:20   ` Nathan Chancellor
2021-11-19 17:44     ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox