public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Daniel Palmer <daniel@0x0f.com>
Cc: lkp@intel.com, kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: [chenxing:msc313_mainlining 41/62] drivers/pinctrl/mstar/pinctrl-mstar.c:88 mstar_pinctrl_parse_groups() error: uninitialized symbol 'ret'.
Date: Mon, 4 Oct 2021 11:01:21 +0300	[thread overview]
Message-ID: <202110021827.APd0FQbV-lkp@intel.com> (raw)

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@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.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


                 reply	other threads:[~2021-10-04  8:01 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=202110021827.APd0FQbV-lkp@intel.com \
    --to=dan.carpenter@oracle.com \
    --cc=daniel@0x0f.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    /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