From: kernel test robot <lkp@intel.com>
To: Ben Widawsky <ben.widawsky@intel.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
Dan Williams <dan.j.williams@intel.com>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: drivers/cxl/pci.c:439:7: warning: Local variable 'rc' shadows outer variable [shadowVariable]
Date: Wed, 6 Apr 2022 02:21:25 +0800 [thread overview]
Message-ID: <202204060228.GdRDR2Xx-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 3123109284176b1532874591f7c81f3837bbdc17
commit: 523e594d9cc03db962c741ce02c8a58aab58a123 cxl/pci: Implement wait for media active
date: 8 weeks ago
config: mips-randconfig-p001-20220404 (https://download.01.org/0day-ci/archive/20220406/202204060228.GdRDR2Xx-lkp@intel.com/config)
compiler: mips64-linux-gcc (GCC) 11.2.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/torvalds/linux.git/commit/?id=523e594d9cc03db962c741ce02c8a58aab58a123
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 523e594d9cc03db962c741ce02c8a58aab58a123
# save the config file to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
mips64-linux-ld: arch/mips/kernel/signal.o: in function `restore_hw_fp_context':
signal.c:(.text+0x1d8): undefined reference to `_restore_fp_context'
mips64-linux-ld: arch/mips/kernel/signal.o: in function `save_hw_fp_context':
signal.c:(.text+0x200): undefined reference to `_save_fp_context'
mips64-linux-ld: arch/mips/kernel/traps.o: in function `trap_init':
>> (.init.text+0x4f8): undefined reference to `handle_fpe'
mips64-linux-ld: (.init.text+0x504): undefined reference to `handle_fpe'
mips64-linux-ld: (.init.text+0x510): undefined reference to `handle_fpe'
cppcheck warnings: (new ones prefixed by >>)
>> drivers/cxl/pci.c:439:7: warning: Local variable 'rc' shadows outer variable [shadowVariable]
int rc;
^
drivers/cxl/pci.c:431:6: note: Shadowed declaration
int rc, i;
^
drivers/cxl/pci.c:439:7: note: Shadow variable
int rc;
^
vim +/rc +439 drivers/cxl/pci.c
420
421 /*
422 * Wait up to @mbox_ready_timeout for the device to report memory
423 * active.
424 */
425 static int wait_for_media_ready(struct cxl_dev_state *cxlds)
426 {
427 struct pci_dev *pdev = to_pci_dev(cxlds->dev);
428 int d = cxlds->cxl_dvsec;
429 bool active = false;
430 u64 md_status;
431 int rc, i;
432
433 rc = wait_for_valid(cxlds);
434 if (rc)
435 return rc;
436
437 for (i = mbox_ready_timeout; i; i--) {
438 u32 temp;
> 439 int rc;
440
441 rc = pci_read_config_dword(
442 pdev, d + CXL_DVSEC_RANGE_SIZE_LOW(0), &temp);
443 if (rc)
444 return rc;
445
446 active = FIELD_GET(CXL_DVSEC_MEM_ACTIVE, temp);
447 if (active)
448 break;
449 msleep(1000);
450 }
451
452 if (!active) {
453 dev_err(&pdev->dev,
454 "timeout awaiting memory active after %d seconds\n",
455 mbox_ready_timeout);
456 return -ETIMEDOUT;
457 }
458
459 md_status = readq(cxlds->regs.memdev + CXLMDEV_STATUS_OFFSET);
460 if (!CXLMDEV_READY(md_status))
461 return -EIO;
462
463 return 0;
464 }
465
--
0-DAY CI Kernel Test Service
https://01.org/lkp
next reply other threads:[~2022-04-05 22:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-05 18:21 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-04-02 11:26 drivers/cxl/pci.c:439:7: warning: Local variable 'rc' shadows outer variable [shadowVariable] kernel test robot
2022-04-03 19:29 ` Randy Dunlap
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=202204060228.GdRDR2Xx-lkp@intel.com \
--to=lkp@intel.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=ben.widawsky@intel.com \
--cc=dan.j.williams@intel.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).