Skip to contentSkip to conversation

kill useless spinlock wrappers in BusLogic

PATCH New Christoph Hellwig 1 participant 1 message Sep 14, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kill useless spinlock wrappers in BusLogic

drivers/scsi/BusLogic.c +8 -8
@@ -2619,7 +2621,7 @@
 	/*
 	   Acquire exclusive access to Host Adapter.
 	 */
-	BusLogic_AcquireHostAdapterLockIH(HostAdapter, &ProcessorFlags);
+	spin_lock_irqsave(HostAdapter->SCSI_Host->host_lock, ProcessorFlags);
 	/*
 	   Handle Interrupts appropriately for each Host Adapter type.
 	 */
@@ -2687,7 +2689,7 @@
 	/*
 	   Release exclusive access to Host Adapter.
 	 */
-	BusLogic_ReleaseHostAdapterLockIH(HostAdapter, &ProcessorFlags);
+	spin_unlock_irqrestore(HostAdapter->SCSI_Host->host_lock, ProcessorFlags);
 	return IRQ_HANDLED;
 }
 
@@ -2775,9 +2777,9 @@
 	 */
 	CCB = BusLogic_AllocateCCB(HostAdapter);
 	if (CCB == NULL) {
-		BusLogic_ReleaseHostAdapterLock(HostAdapter);
+		spin_unlock_irq(HostAdapter->SCSI_Host->host_lock);
 		BusLogic_Delay(1);
-		BusLogic_AcquireHostAdapterLock(HostAdapter);
+		spin_lock_irq(HostAdapter->SCSI_Host->host_lock);
 		CCB = BusLogic_AllocateCCB(HostAdapter);
 		if (CCB == NULL) {
 			Command->result = DID_ERROR << 16;
@@ -2901,10 +2903,10 @@
 		   error as a Host Adapter Hard Reset should be initiated soon.
 		 */
 		if (!BusLogic_WriteOutgoingMailbox(HostAdapter, BusLogic_MailboxStartCommand, CCB)) {
-			BusLogic_ReleaseHostAdapterLock(HostAdapter);
+			spin_unlock_irq(HostAdapter->SCSI_Host->host_lock);
 			BusLogic_Warning("Unable to write Outgoing Mailbox - " "Pausing for 1 second\n", HostAdapter);
 			BusLogic_Delay(1);
-			BusLogic_AcquireHostAdapterLock(HostAdapter);
+			spin_lock_irq(HostAdapter->SCSI_Host->host_lock);
 			if (!BusLogic_WriteOutgoingMailbox(HostAdapter, BusLogic_MailboxStartCommand, CCB)) {
 				BusLogic_Warning("Still unable to write Outgoing Mailbox - " "Host Adapter Dead?\n", HostAdapter);
 				BusLogic_DeallocateCCB(CCB);
@@ -3042,9 +3044,9 @@
 	 */
 
 	if (HardReset) {
-		BusLogic_ReleaseHostAdapterLock(HostAdapter);
+		spin_unlock_irq(HostAdapter->SCSI_Host->host_lock);
 		BusLogic_Delay(HostAdapter->BusSettleTime);
-		BusLogic_AcquireHostAdapterLock(HostAdapter);
+		spin_lock_irq(HostAdapter->SCSI_Host->host_lock);
 	}
 
 	for (TargetID = 0; TargetID < HostAdapter->MaxTargetDevices; TargetID++) {

===== drivers/scsi/BusLogic.h 1.19 vs edited =====

drivers/scsi/BusLogic.h +0 -40
@@ -1169,46 +1169,6 @@
 	unsigned char ProductRevisionLevel[4];	/* Bytes 32-35 */
 };
 
-/*
-  BusLogic_AcquireHostAdapterLock acquires exclusive access to Host Adapter.
-*/
-
-static inline void BusLogic_AcquireHostAdapterLock(struct BusLogic_HostAdapter *HostAdapter)
-{
-	spin_lock_irq(HostAdapter->SCSI_Host->host_lock);
-}
-
-/*
-  BusLogic_ReleaseHostAdapterLock releases exclusive access to Host Adapter.
-*/
-
-static inline void BusLogic_ReleaseHostAdapterLock(struct BusLogic_HostAdapter *HostAdapter)
-{
-	spin_unlock_irq(HostAdapter->SCSI_Host->host_lock);
-}
-
-
-/*
-  BusLogic_AcquireHostAdapterLockIH acquires exclusive access to Host Adapter,
-  but is only called from the interrupt handler.
-*/
-
-static inline void BusLogic_AcquireHostAdapterLockIH(struct BusLogic_HostAdapter *HostAdapter, unsigned long *ProcessorFlags)
-{
-	spin_lock_irqsave(HostAdapter->SCSI_Host->host_lock, *ProcessorFlags);
-}
-
-
-/*
-  BusLogic_ReleaseHostAdapterLockIH releases exclusive access to Host Adapter,
-  but is only called from the interrupt handler.
-*/
-
-static inline void BusLogic_ReleaseHostAdapterLockIH(struct BusLogic_HostAdapter *HostAdapter, unsigned long *ProcessorFlags)
-{
-	spin_unlock_irqrestore(HostAdapter->SCSI_Host->host_lock, *ProcessorFlags);
-}
-
 
 /*
   Define functions to provide an abstraction for reading and writing the