From: kernel test robot <lkp@intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
linux-kernel@vger.kernel.org,
Linus Walleij <linus.walleij@linaro.org>
Subject: [pinctrl-intel:review-andy 18/19] drivers/pinctrl/pinctrl-zynqmp.c:825:13: warning: variable 'pin' is uninitialized when used here
Date: Fri, 19 Nov 2021 16:08:32 +0800 [thread overview]
Message-ID: <202111191618.SSj1gGvK-lkp@intel.com> (raw)
[-- 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 --]
next reply other threads:[~2021-11-19 8:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-19 8:08 kernel test robot [this message]
2021-11-19 8:33 ` [pinctrl-intel:review-andy 18/19] drivers/pinctrl/pinctrl-zynqmp.c:825:13: warning: variable 'pin' is uninitialized when used here Andy Shevchenko
2021-11-19 17:20 ` Nathan Chancellor
2021-11-19 17:44 ` Andy Shevchenko
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=202111191618.SSj1gGvK-lkp@intel.com \
--to=lkp@intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=kbuild-all@lists.01.org \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox