• Arnd Bergmann's avatar
    scsi: aha1542: avoid uninitialized variable warnings · ec54adfb
    Arnd Bergmann authored
    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: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    ec54adfb
aha1542.c 28.6 KB