From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [sashal-linux-stable:queue-5.12 624/829] drivers/pinctrl/pinctrl-single.c:704:6: warning: variable 'num_pins_in_register' set but not used
Date: Sun, 09 May 2021 09:03:29 +0800 [thread overview]
Message-ID: <202105090924.ZFZY7XCS-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 6480 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git queue-5.12
head: 1dc493182bec339b74b4d5a77f64c8235b5123ab
commit: aec62b4024a18a9211a17a53104464ec3e0a861d [624/829] pinctrl: pinctrl-single: remove unused parameter
config: nds32-randconfig-r011-20210509 (attached as .config)
compiler: nds32le-linux-gcc (GCC) 9.3.0
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
# https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git/commit/?id=aec62b4024a18a9211a17a53104464ec3e0a861d
git remote add sashal-linux-stable https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
git fetch --no-tags sashal-linux-stable queue-5.12
git checkout aec62b4024a18a9211a17a53104464ec3e0a861d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=nds32
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-single.c: In function 'pcs_allocate_pin_table':
>> drivers/pinctrl/pinctrl-single.c:704:6: warning: variable 'num_pins_in_register' set but not used [-Wunused-but-set-variable]
704 | int num_pins_in_register = 0;
| ^~~~~~~~~~~~~~~~~~~~
vim +/num_pins_in_register +704 drivers/pinctrl/pinctrl-single.c
8b8b091bf07fa7e Tony Lindgren 2012-07-10 691
8b8b091bf07fa7e Tony Lindgren 2012-07-10 692 /**
8b8b091bf07fa7e Tony Lindgren 2012-07-10 693 * pcs_allocate_pin_table() - adds all the pins for the pinctrl driver
8b8b091bf07fa7e Tony Lindgren 2012-07-10 694 * @pcs: pcs driver instance
8b8b091bf07fa7e Tony Lindgren 2012-07-10 695 *
8b8b091bf07fa7e Tony Lindgren 2012-07-10 696 * In case of errors, resources are freed in pcs_free_resources.
8b8b091bf07fa7e Tony Lindgren 2012-07-10 697 *
8b8b091bf07fa7e Tony Lindgren 2012-07-10 698 * If your hardware needs holes in the address space, then just set
8b8b091bf07fa7e Tony Lindgren 2012-07-10 699 * up multiple driver instances.
8b8b091bf07fa7e Tony Lindgren 2012-07-10 700 */
150632b09aadf19 Greg Kroah-Hartman 2012-12-21 701 static int pcs_allocate_pin_table(struct pcs_device *pcs)
8b8b091bf07fa7e Tony Lindgren 2012-07-10 702 {
8b8b091bf07fa7e Tony Lindgren 2012-07-10 703 int mux_bytes, nr_pins, i;
6f924b0b7cbe2a3 Manjunathappa, Prakash 2013-05-21 @704 int num_pins_in_register = 0;
8b8b091bf07fa7e Tony Lindgren 2012-07-10 705
8b8b091bf07fa7e Tony Lindgren 2012-07-10 706 mux_bytes = pcs->width / BITS_PER_BYTE;
4e7e8017a80e181 Manjunathappa, Prakash 2013-05-21 707
4e7e8017a80e181 Manjunathappa, Prakash 2013-05-21 708 if (pcs->bits_per_mux) {
4e7e8017a80e181 Manjunathappa, Prakash 2013-05-21 709 pcs->bits_per_pin = fls(pcs->fmask);
4e7e8017a80e181 Manjunathappa, Prakash 2013-05-21 710 nr_pins = (pcs->size * BITS_PER_BYTE) / pcs->bits_per_pin;
6f924b0b7cbe2a3 Manjunathappa, Prakash 2013-05-21 711 num_pins_in_register = pcs->width / pcs->bits_per_pin;
4e7e8017a80e181 Manjunathappa, Prakash 2013-05-21 712 } else {
8b8b091bf07fa7e Tony Lindgren 2012-07-10 713 nr_pins = pcs->size / mux_bytes;
4e7e8017a80e181 Manjunathappa, Prakash 2013-05-21 714 }
8b8b091bf07fa7e Tony Lindgren 2012-07-10 715
8b8b091bf07fa7e Tony Lindgren 2012-07-10 716 dev_dbg(pcs->dev, "allocating %i pins\n", nr_pins);
a86854d0c599b32 Kees Cook 2018-06-12 717 pcs->pins.pa = devm_kcalloc(pcs->dev,
a86854d0c599b32 Kees Cook 2018-06-12 718 nr_pins, sizeof(*pcs->pins.pa),
8b8b091bf07fa7e Tony Lindgren 2012-07-10 719 GFP_KERNEL);
8b8b091bf07fa7e Tony Lindgren 2012-07-10 720 if (!pcs->pins.pa)
8b8b091bf07fa7e Tony Lindgren 2012-07-10 721 return -ENOMEM;
8b8b091bf07fa7e Tony Lindgren 2012-07-10 722
8b8b091bf07fa7e Tony Lindgren 2012-07-10 723 pcs->desc.pins = pcs->pins.pa;
8b8b091bf07fa7e Tony Lindgren 2012-07-10 724 pcs->desc.npins = nr_pins;
8b8b091bf07fa7e Tony Lindgren 2012-07-10 725
8b8b091bf07fa7e Tony Lindgren 2012-07-10 726 for (i = 0; i < pcs->desc.npins; i++) {
8b8b091bf07fa7e Tony Lindgren 2012-07-10 727 unsigned offset;
8b8b091bf07fa7e Tony Lindgren 2012-07-10 728 int res;
4e7e8017a80e181 Manjunathappa, Prakash 2013-05-21 729 int byte_num;
8b8b091bf07fa7e Tony Lindgren 2012-07-10 730
4e7e8017a80e181 Manjunathappa, Prakash 2013-05-21 731 if (pcs->bits_per_mux) {
4e7e8017a80e181 Manjunathappa, Prakash 2013-05-21 732 byte_num = (pcs->bits_per_pin * i) / BITS_PER_BYTE;
4e7e8017a80e181 Manjunathappa, Prakash 2013-05-21 733 offset = (byte_num / mux_bytes) * mux_bytes;
4e7e8017a80e181 Manjunathappa, Prakash 2013-05-21 734 } else {
8b8b091bf07fa7e Tony Lindgren 2012-07-10 735 offset = i * mux_bytes;
4e7e8017a80e181 Manjunathappa, Prakash 2013-05-21 736 }
aec62b4024a18a9 Hanna Hawa 2021-03-19 737 res = pcs_add_pin(pcs, offset);
8b8b091bf07fa7e Tony Lindgren 2012-07-10 738 if (res < 0) {
8b8b091bf07fa7e Tony Lindgren 2012-07-10 739 dev_err(pcs->dev, "error adding pins: %i\n", res);
8b8b091bf07fa7e Tony Lindgren 2012-07-10 740 return res;
8b8b091bf07fa7e Tony Lindgren 2012-07-10 741 }
8b8b091bf07fa7e Tony Lindgren 2012-07-10 742 }
8b8b091bf07fa7e Tony Lindgren 2012-07-10 743
8b8b091bf07fa7e Tony Lindgren 2012-07-10 744 return 0;
8b8b091bf07fa7e Tony Lindgren 2012-07-10 745 }
8b8b091bf07fa7e Tony Lindgren 2012-07-10 746
:::::: The code at line 704 was first introduced by commit
:::::: 6f924b0b7cbe2a3d9c08f6134343fd366c35fdfa pinctrl: pinctrl-single: pin names for pinctrl-single.bits
:::::: TO: Manjunathappa, Prakash <prakash.pm@ti.com>
:::::: CC: Linus Walleij <linus.walleij@linaro.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 30253 bytes --]
reply other threads:[~2021-05-09 1:03 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=202105090924.ZFZY7XCS-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.