]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: aha1542: avoid uninitialized variable warnings
authorArnd Bergmann <arnd@arndb.de>
Wed, 27 Jan 2016 15:57:22 +0000 (16:57 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 24 Feb 2016 02:27:02 +0000 (21:27 -0500)
commit708476e1b3d127d407fd87468673620d2abb6c3e
tree9eb5859c1db90d0e1127b1a0b02f22dabc9e49d2
parentc28838b934753f1b4430c65a35da46a66fab386b
scsi: aha1542: avoid uninitialized variable warnings

Gcc incorrectly detects that two variables in aha1542_queuecommand might
be used without an initialization:

scsi/aha1542.c: In function 'aha1542_queuecommand':
scsi/aha1542.c:382:16: error: 'cptr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
scsi/aha1542.c:379:11: error: 'sg_count' may be used uninitialized in this function [-Werror=maybe-uninitialized]

The only user of these is doing the same check that the assigment has,
so it is actually guaranteed to work. Adding an "else" clause with a
fake initialization shuts up the warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/aha1542.c