BusLogic gcc 4.1 warning fixes
Subsystems (2)
PATCH 1/1 BusLogic gcc 4.1 warning fixes
This at least makes the used away of the failure .
---
I just commented out BusLogic_AbortCommand because the code that uses it is commented out the same way .. It could just be removed .
Fixes the following warnings,
drivers/scsi/BusLogic.c: In function 'BusLogic_init':drivers/scsi/BusLogic.c:2302: warning: ignoring return value of 'scsi_add_host', declared with attribute warn_unused_result drivers/scsi/BusLogic.c: At top level:drivers/scsi/BusLogic.c:2963: warning: 'BusLogic_AbortCommand' defined but not used
drivers/scsi/BusLogic.c +4 -1
@@ -2299,7 +2299,8 @@ static int __init BusLogic_init(void)scsi_host_put (Host); }else {BusLogic_InitializeHostStructure (HostAdapter, Host); -scsi_add_host (Host, HostAdapter->PCI_Device ? &HostAdapter->PCI_Device->dev :NULL ); +if (scsi_add_host (Host, HostAdapter->PCI_Device ? &HostAdapter->PCI_Device->dev :NULL )) +printk (KERN_WARNING "BusLogic: scsi_add_host() failed!\n" );scsi_scan_host (Host); BusLogicHostAdapterCount++; }
@@ -2955,6 +2956,7 @@ static int BusLogic_QueueCommand(struct } +#if 0 /* BusLogic_AbortCommand aborts Command if possible. */
@@ -3025,6 +3027,7 @@ static int BusLogic_AbortCommand(struct return SUCCESS; } +#endif /* BusLogic_ResetHostAdapter resets Host Adapter if possible, marking all currently executing SCSI Commands as having been Reset.
Quoted 32 lines · Daniel Walker
This at least makes the used away of the failure .
---I just commented out
BusLogic_AbortCommandbecause the code that uses it is commented out the same way .. It could just be removed .Fixes the following warnings,
drivers/scsi/BusLogic.c: In function 'BusLogic_init':drivers/scsi/BusLogic.c:2302: warning: ignoring return value of 'scsi_add_host', declared with attributewarn_unused_resultdrivers/scsi/BusLogic.c: At top level:drivers/scsi/BusLogic.c:2963: warning: 'BusLogic_AbortCommand' defined but not usedSigned-off-by Daniel Walker <[email protected]>Index:
linux-2.6.16/drivers/scsi/BusLogic.c
===================================================================drivers/scsi/BusLogic.c +2
-1@@ -2299,7 +2299,8 @@ static int __init BusLogic_init(void)scsi_host_put (Host); }else {BusLogic_InitializeHostStructure (HostAdapter, Host); -scsi_add_host (Host, HostAdapter->PCI_Device ? &HostAdapter->PCI_Device->dev :NULL ); +if (scsi_add_host (Host, HostAdapter->PCI_Device ? &HostAdapter->PCI_Device->dev :NULL )) +printk (KERN_WARNING "BusLogic: scsi_add_host() failed!\n" );scsi_scan_host (Host); BusLogicHostAdapterCount++; }
drivers/scsi/BusLogic.c static int BusLogic_QueueCommand(struct · line 2956
Quoted 1 line
drivers/scsi/BusLogic.c +0
-0@@ -2955,6 +2956,7 @@ static int BusLogic_QueueCommand(struct }
Methinks that if scsi_add_host() fails we'll need to do more serious things here - we cannot just go ahead and pretend that it worked.
So it's best to leave the warning there for now.
The appropriate recovery code is just a few lines up from here - reusing that might be appropriate. And while you're there, this function should return -Esomething if it failed, rather than pretending to work.