Re: [PATCH 3/5] s390/pci: Move three assignments for the variable "rc" in clp_normal_command()

From: kbuild test robot
Date: Sat Jan 21 2017 - 14:24:23 EST


Hi Markus,

[auto build test WARNING on s390/features]
[also build test WARNING on v4.10-rc4 next-20170120]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/SF-Markus-Elfring/s390-pci-Fine-tuning-for-three-function-implementations/20170122-021955
base: https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git features
config: s390-allmodconfig (attached as .config)
compiler: s390x-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=s390

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

arch/s390/pci/pci_clp.c: In function 'clp_misc_ioctl':
>> arch/s390/pci/pci_clp.c:543:5: warning: 'rc' may be used uninitialized in this function [-Wmaybe-uninitialized]
if (rc)
^
arch/s390/pci/pci_clp.c:515:6: note: 'rc' was declared here
int rc;
^~

vim +/rc +543 arch/s390/pci/pci_clp.c

988b86e69 Martin Schwidefsky 2016-01-13 527 goto out_free;
e201d01da Markus Elfring 2017-01-21 528 }
988b86e69 Martin Schwidefsky 2016-01-13 529
e201d01da Markus Elfring 2017-01-21 530 if (lpcb->fmt != 0 || lpcb->reserved1 != 0 || lpcb->reserved2 != 0) {
988b86e69 Martin Schwidefsky 2016-01-13 531 rc = -EINVAL;
988b86e69 Martin Schwidefsky 2016-01-13 532 goto out_free;
e201d01da Markus Elfring 2017-01-21 533 }
988b86e69 Martin Schwidefsky 2016-01-13 534
988b86e69 Martin Schwidefsky 2016-01-13 535 switch (req->lps) {
988b86e69 Martin Schwidefsky 2016-01-13 536 case 0:
988b86e69 Martin Schwidefsky 2016-01-13 537 rc = clp_base_command(req, lpcb);
988b86e69 Martin Schwidefsky 2016-01-13 538 break;
988b86e69 Martin Schwidefsky 2016-01-13 539 case 2:
988b86e69 Martin Schwidefsky 2016-01-13 540 rc = clp_pci_command(req, lpcb);
988b86e69 Martin Schwidefsky 2016-01-13 541 break;
988b86e69 Martin Schwidefsky 2016-01-13 542 }
988b86e69 Martin Schwidefsky 2016-01-13 @543 if (rc)
988b86e69 Martin Schwidefsky 2016-01-13 544 goto out_free;
988b86e69 Martin Schwidefsky 2016-01-13 545
988b86e69 Martin Schwidefsky 2016-01-13 546 if (copy_to_user(uptr, lpcb, PAGE_SIZE) != 0)
e201d01da Markus Elfring 2017-01-21 547 rc = -EFAULT;
988b86e69 Martin Schwidefsky 2016-01-13 548
988b86e69 Martin Schwidefsky 2016-01-13 549 rc = 0;
988b86e69 Martin Schwidefsky 2016-01-13 550
988b86e69 Martin Schwidefsky 2016-01-13 551 out_free:

:::::: The code at line 543 was first introduced by commit
:::::: 988b86e69ded17f0f1209fd3ef1c4c7f1567dcc1 s390/pci: add ioctl interface for CLP

:::::: TO: Martin Schwidefsky <schwidefsky@xxxxxxxxxx>
:::::: CC: Martin Schwidefsky <schwidefsky@xxxxxxxxxx>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip