[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202110021827.APd0FQbV-lkp@intel.com>
Date: Mon, 4 Oct 2021 11:01:21 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: kbuild@...ts.01.org, Daniel Palmer <daniel@...f.com>
Cc: lkp@...el.com, kbuild-all@...ts.01.org,
linux-kernel@...r.kernel.org
Subject: [chenxing:msc313_mainlining 41/62]
drivers/pinctrl/mstar/pinctrl-mstar.c:88 mstar_pinctrl_parse_groups() error:
uninitialized symbol 'ret'.
tree: git://github.com/linux-chenxing/linux.git msc313_mainlining
head: 1b2db4b2c68fdb4acc386166e82a28dfbc808705
commit: c4c8b6c55a5a3880c67510369fd6c3bebe11d1f3 [41/62] pinctrl: mstar: msc313 pinctrl driver
config: mips-randconfig-m031-20211002 (attached as .config)
compiler: mipsel-linux-gcc (GCC) 11.2.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
smatch warnings:
drivers/pinctrl/mstar/pinctrl-mstar.c:88 mstar_pinctrl_parse_groups() error: uninitialized symbol 'ret'.
drivers/pinctrl/mstar/pinctrl-mstar.c:112 mstar_pinctrl_parse_functions() error: uninitialized symbol 'ret'.
vim +/ret +88 drivers/pinctrl/mstar/pinctrl-mstar.c
e2eeeecce8807b0 Daniel Palmer 2021-09-18 77
e2eeeecce8807b0 Daniel Palmer 2021-09-18 78 int mstar_pinctrl_parse_groups(struct msc313_pinctrl *pinctrl)
e2eeeecce8807b0 Daniel Palmer 2021-09-18 79 {
e2eeeecce8807b0 Daniel Palmer 2021-09-18 80 int i, ret;
e2eeeecce8807b0 Daniel Palmer 2021-09-18 81
e2eeeecce8807b0 Daniel Palmer 2021-09-18 82 for (i = 0; i < pinctrl->info->ngroups; i++) {
The kbuild bot does not use cross function analysis so it doesn't
know that "pinctrl->info->ngroups". Even if it used cross function
analysis it probably wouldn't be smart enough.
e2eeeecce8807b0 Daniel Palmer 2021-09-18 83 const struct msc313_pinctrl_group *grp = &pinctrl->info->groups[i];
e2eeeecce8807b0 Daniel Palmer 2021-09-18 84
e2eeeecce8807b0 Daniel Palmer 2021-09-18 85 ret = pinctrl_generic_add_group(pinctrl->pctl, grp->name,
e2eeeecce8807b0 Daniel Palmer 2021-09-18 86 (int *) grp->pins, grp->numpins, NULL);
e2eeeecce8807b0 Daniel Palmer 2021-09-18 87 }
e2eeeecce8807b0 Daniel Palmer 2021-09-18 @88 return ret;
This just returns the last return, so if something fails in the middle
it will return success.
e2eeeecce8807b0 Daniel Palmer 2021-09-18 89 }
e2eeeecce8807b0 Daniel Palmer 2021-09-18 90
e2eeeecce8807b0 Daniel Palmer 2021-09-18 91 int mstar_pinctrl_parse_functions(struct msc313_pinctrl *pinctrl)
e2eeeecce8807b0 Daniel Palmer 2021-09-18 92 {
e2eeeecce8807b0 Daniel Palmer 2021-09-18 93 int i, ret;
e2eeeecce8807b0 Daniel Palmer 2021-09-18 94
e2eeeecce8807b0 Daniel Palmer 2021-09-18 95 for (i = 0; i < pinctrl->info->nfunctions; i++) {
e2eeeecce8807b0 Daniel Palmer 2021-09-18 96 const struct msc313_pinctrl_function *func = &pinctrl->info->functions[i];
e2eeeecce8807b0 Daniel Palmer 2021-09-18 97
e2eeeecce8807b0 Daniel Palmer 2021-09-18 98 // clear any existing value for the function
e2eeeecce8807b0 Daniel Palmer 2021-09-18 99 if (func->reg >= 0) {
e2eeeecce8807b0 Daniel Palmer 2021-09-18 100 regmap_update_bits(pinctrl->regmap, func->reg,
e2eeeecce8807b0 Daniel Palmer 2021-09-18 101 func->mask, 0);
e2eeeecce8807b0 Daniel Palmer 2021-09-18 102 }
e2eeeecce8807b0 Daniel Palmer 2021-09-18 103
e2eeeecce8807b0 Daniel Palmer 2021-09-18 104 ret = pinmux_generic_add_function(pinctrl->pctl, func->name,
e2eeeecce8807b0 Daniel Palmer 2021-09-18 105 (const char **) func->groups, func->numgroups, (void *) func);
e2eeeecce8807b0 Daniel Palmer 2021-09-18 106 if (ret < 0) {
e2eeeecce8807b0 Daniel Palmer 2021-09-18 107 dev_err(pinctrl->dev, "failed to add function: %d", ret);
e2eeeecce8807b0 Daniel Palmer 2021-09-18 108 goto out;
e2eeeecce8807b0 Daniel Palmer 2021-09-18 109 }
e2eeeecce8807b0 Daniel Palmer 2021-09-18 110 }
e2eeeecce8807b0 Daniel Palmer 2021-09-18 111 out:
e2eeeecce8807b0 Daniel Palmer 2021-09-18 @112 return ret;
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Powered by blists - more mailing lists