Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d2afb3ae authored by Daniel Walker's avatar Daniel Walker Committed by James Bottomley
Browse files

[SCSI] BusLogic gcc 4.1 warning fixes



- Reworked all the very long lines in that block (this drivers full of
  them though)

- Returns an error in three places that it didn't before.

- Properly clean up after a scsi_add_host() failure.

Signed-off-by: default avatarDaniel Walker <dwalker@mvista.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 4041b9cd
Loading
Loading
Loading
Loading
+37 −9
Original line number Original line Diff line number Diff line
@@ -2176,6 +2176,7 @@ static int __init BusLogic_init(void)
{
{
	int BusLogicHostAdapterCount = 0, DriverOptionsIndex = 0, ProbeIndex;
	int BusLogicHostAdapterCount = 0, DriverOptionsIndex = 0, ProbeIndex;
	struct BusLogic_HostAdapter *PrototypeHostAdapter;
	struct BusLogic_HostAdapter *PrototypeHostAdapter;
	int ret = 0;


#ifdef MODULE
#ifdef MODULE
	if (BusLogic)
	if (BusLogic)
@@ -2282,26 +2283,50 @@ static int __init BusLogic_init(void)
		   perform Target Device Inquiry.
		   perform Target Device Inquiry.
		 */
		 */
		if (BusLogic_ReadHostAdapterConfiguration(HostAdapter) &&
		if (BusLogic_ReadHostAdapterConfiguration(HostAdapter) &&
		    BusLogic_ReportHostAdapterConfiguration(HostAdapter) && BusLogic_AcquireResources(HostAdapter) && BusLogic_CreateInitialCCBs(HostAdapter) && BusLogic_InitializeHostAdapter(HostAdapter) && BusLogic_TargetDeviceInquiry(HostAdapter)) {
		    BusLogic_ReportHostAdapterConfiguration(HostAdapter) &&
		    BusLogic_AcquireResources(HostAdapter) &&
		    BusLogic_CreateInitialCCBs(HostAdapter) &&
		    BusLogic_InitializeHostAdapter(HostAdapter) &&
		    BusLogic_TargetDeviceInquiry(HostAdapter)) {
			/*
			/*
			   Initialization has been completed successfully.  Release and
			   Initialization has been completed successfully.  Release and
			   re-register usage of the I/O Address range so that the Model
			   re-register usage of the I/O Address range so that the Model
			   Name of the Host Adapter will appear, and initialize the SCSI
			   Name of the Host Adapter will appear, and initialize the SCSI
			   Host structure.
			   Host structure.
			 */
			 */
			release_region(HostAdapter->IO_Address, HostAdapter->AddressCount);
			release_region(HostAdapter->IO_Address,
			if (!request_region(HostAdapter->IO_Address, HostAdapter->AddressCount, HostAdapter->FullModelName)) {
				       HostAdapter->AddressCount);
				printk(KERN_WARNING "BusLogic: Release and re-register of " "port 0x%04lx failed \n", (unsigned long) HostAdapter->IO_Address);
			if (!request_region(HostAdapter->IO_Address,
					    HostAdapter->AddressCount,
					    HostAdapter->FullModelName)) {
				printk(KERN_WARNING
					"BusLogic: Release and re-register of "
					"port 0x%04lx failed \n",
					(unsigned long)HostAdapter->IO_Address);
				BusLogic_DestroyCCBs(HostAdapter);
				BusLogic_ReleaseResources(HostAdapter);
				list_del(&HostAdapter->host_list);
				scsi_host_put(Host);
				ret = -ENOMEM;
			} else {
				BusLogic_InitializeHostStructure(HostAdapter,
								 Host);
				if (scsi_add_host(Host, HostAdapter->PCI_Device
						? &HostAdapter->PCI_Device->dev
						  : NULL)) {
					printk(KERN_WARNING
					       "BusLogic: scsi_add_host()"
					       "failed!\n");
					BusLogic_DestroyCCBs(HostAdapter);
					BusLogic_DestroyCCBs(HostAdapter);
					BusLogic_ReleaseResources(HostAdapter);
					BusLogic_ReleaseResources(HostAdapter);
					list_del(&HostAdapter->host_list);
					list_del(&HostAdapter->host_list);
					scsi_host_put(Host);
					scsi_host_put(Host);
					ret = -ENODEV;
				} else {
				} else {
				BusLogic_InitializeHostStructure(HostAdapter, Host);
				scsi_add_host(Host, HostAdapter->PCI_Device ? &HostAdapter->PCI_Device->dev : NULL);
					scsi_scan_host(Host);
					scsi_scan_host(Host);
					BusLogicHostAdapterCount++;
					BusLogicHostAdapterCount++;
				}
				}
			}
		} else {
		} else {
			/*
			/*
			   An error occurred during Host Adapter Configuration Querying, Host
			   An error occurred during Host Adapter Configuration Querying, Host
@@ -2315,12 +2340,13 @@ static int __init BusLogic_init(void)
			BusLogic_ReleaseResources(HostAdapter);
			BusLogic_ReleaseResources(HostAdapter);
			list_del(&HostAdapter->host_list);
			list_del(&HostAdapter->host_list);
			scsi_host_put(Host);
			scsi_host_put(Host);
			ret = -ENODEV;
		}
		}
	}
	}
	kfree(PrototypeHostAdapter);
	kfree(PrototypeHostAdapter);
	kfree(BusLogic_ProbeInfoList);
	kfree(BusLogic_ProbeInfoList);
	BusLogic_ProbeInfoList = NULL;
	BusLogic_ProbeInfoList = NULL;
	return 0;
	return ret;
}
}




@@ -2954,6 +2980,7 @@ static int BusLogic_QueueCommand(struct scsi_cmnd *Command, void (*CompletionRou
}
}




#if 0
/*
/*
  BusLogic_AbortCommand aborts Command if possible.
  BusLogic_AbortCommand aborts Command if possible.
*/
*/
@@ -3024,6 +3051,7 @@ static int BusLogic_AbortCommand(struct scsi_cmnd *Command)
	return SUCCESS;
	return SUCCESS;
}
}


#endif
/*
/*
  BusLogic_ResetHostAdapter resets Host Adapter if possible, marking all
  BusLogic_ResetHostAdapter resets Host Adapter if possible, marking all
  currently executing SCSI Commands as having been Reset.
  currently executing SCSI Commands as having been Reset.