Skip to contentSkip to conversation

libata: kill confusing @action local variable from ata_eh_reset()

PATCH RESEND In review Tejun Heo 1 participant 2 messages Oct 24, 2007 libata

lore
Share & tools
lore

Tejun Heo

author
#0 lore raw

PATCH RESEND 1/1 libata: kill confusing @action local variable from ata_eh_reset()

Local variable @action in ata_eh_reset() is used only once after assignment and as all other operations are done on ehc->i.action directly, it can be a bit confusing. Kill it.

---
Forgot subject in the first posting, re-posting. Sorry.

 drivers/ata/libata-eh.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/ata/libata-eh.c +1 -3
index 93e2b54..5e3f66c 100644
@@ -2071,7 +2071,6 @@ int ata_eh_reset(struct ata_link *link, int classify,
 	int try = 0;
 	struct ata_device *dev;
 	unsigned long deadline;
-	unsigned int action;
 	ata_reset_fn_t reset;
 	unsigned long flags;
 	int rc;
@@ -2086,11 +2085,10 @@ int ata_eh_reset(struct ata_link *link, int classify,
 	/* Determine which reset to use and record in ehc->i.action.
 	 * prereset() may examine and modify it.
 	 */
-	action = ehc->i.action;
 	ehc->i.action &= ~ATA_EH_RESET_MASK;
 	if (softreset && (!hardreset || (!(link->flags & ATA_LFLAG_NO_SRST) &&
 					 !sata_set_spd_needed(link) &&
-					 !(action & ATA_EH_HARDRESET))))
+					 !(ehc->i.action & ATA_EH_HARDRESET))))
 		ehc->i.action |= ATA_EH_SOFTRESET;
 	else
 		ehc->i.action |= ATA_EH_HARDRESET;
author
#1 lore raw
Quoted 5 lines · Tejun Heo

Local variable @action in ata_eh_reset() is used only once after assignment and as all other operations are done on ehc->i.action directly, it can be a bit confusing. Kill it.

Eeeek, I take this patch back. I'll post another one soon. Sorry about the confusion.

Signature · 1 line
tejun