Skip to content

Commit f46e7cd

Browse files
arndbmartinkpetersen
authored andcommitted
scsi: advansys: fix build warning for PCI=n
The advansys probe function tries to handle both ISA and PCI cases, each hidden in an #ifdef when unused. This leads to a warning indicating that when PCI is disabled we could be using uninitialized data: drivers/scsi/advansys.c: In function advansys_board_found : drivers/scsi/advansys.c:11036:5: error: ret may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/scsi/advansys.c:10928:28: note: ret was declared here drivers/scsi/advansys.c:11309:8: error: share_irq may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/scsi/advansys.c:10928:6: note: share_irq was declared here This cannot happen in practice because the hardware in question only exists for PCI, but changing the code to just error out here is better for consistency and avoids the warning. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent d5c3eb2 commit f46e7cd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/scsi/advansys.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11030,6 +11030,9 @@ static int advansys_board_found(struct Scsi_Host *shost, unsigned int iop,
1103011030
ASC_DBG(2, "AdvInitGetConfig()\n");
1103111031

1103211032
ret = AdvInitGetConfig(pdev, shost) ? -ENODEV : 0;
11033+
#else
11034+
share_irq = 0;
11035+
ret = -ENODEV;
1103311036
#endif /* CONFIG_PCI */
1103411037
}
1103511038

0 commit comments

Comments
 (0)