]> git.baikalelectronics.ru Git - kernel.git/commit
s390: pci: don't print uninitialized data for debugging
authorArnd Bergmann <arnd@arndb.de>
Thu, 10 Nov 2016 16:44:48 +0000 (17:44 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 11 Nov 2016 16:45:08 +0000 (08:45 -0800)
commit06fc0974ae486715073f7934baa0e6eeeed58508
treeaf05e2169fc95c6560ccb3e13148d183e7c99dff
parent26cce03eecac0ca4a6ead2e5ed46dae08f2b5928
s390: pci: don't print uninitialized data for debugging

gcc correctly warns about an incorrect use of the 'pa' variable in case
we pass an empty scatterlist to __s390_dma_map_sg:

  arch/s390/pci/pci_dma.c: In function '__s390_dma_map_sg':
  arch/s390/pci/pci_dma.c:309:13: warning: 'pa' may be used uninitialized in this function [-Wmaybe-uninitialized]

This adds a bogus initialization to the function to sanitize the debug
output.  I would have preferred a solution without the initialization,
but I only got the report from the kbuild bot after turning on the
warning again, and didn't manage to reproduce it myself.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/s390/pci/pci_dma.c