Skip to content

Commit

Permalink
[PATCH] libata: move ata_eh_clear_action() upward
Browse files Browse the repository at this point in the history
Move ata_eh_clear_action() upward.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Jun 27, 2006
1 parent 41542db commit af181c2
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions drivers/scsi/libata-eh.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,31 @@ static int ata_ering_map(struct ata_ering *ering,
return rc;
}

static void ata_eh_clear_action(struct ata_device *dev,
struct ata_eh_info *ehi, unsigned int action)
{
int i;

if (!dev) {
ehi->action &= ~action;
for (i = 0; i < ATA_MAX_DEVICES; i++)
ehi->dev_action[i] &= ~action;
} else {
/* doesn't make sense for port-wide EH actions */
WARN_ON(!(action & ATA_EH_PERDEV_MASK));

/* break ehi->action into ehi->dev_action */
if (ehi->action & action) {
for (i = 0; i < ATA_MAX_DEVICES; i++)
ehi->dev_action[i] |= ehi->action & action;
ehi->action &= ~action;
}

/* turn off the specified per-dev action */
ehi->dev_action[dev->devno] &= ~action;
}
}

/**
* ata_scsi_timed_out - SCSI layer time out callback
* @cmd: timed out SCSI command
Expand Down Expand Up @@ -705,31 +730,6 @@ static void ata_eh_detach_dev(struct ata_device *dev)
spin_unlock_irqrestore(ap->lock, flags);
}

static void ata_eh_clear_action(struct ata_device *dev,
struct ata_eh_info *ehi, unsigned int action)
{
int i;

if (!dev) {
ehi->action &= ~action;
for (i = 0; i < ATA_MAX_DEVICES; i++)
ehi->dev_action[i] &= ~action;
} else {
/* doesn't make sense for port-wide EH actions */
WARN_ON(!(action & ATA_EH_PERDEV_MASK));

/* break ehi->action into ehi->dev_action */
if (ehi->action & action) {
for (i = 0; i < ATA_MAX_DEVICES; i++)
ehi->dev_action[i] |= ehi->action & action;
ehi->action &= ~action;
}

/* turn off the specified per-dev action */
ehi->dev_action[dev->devno] &= ~action;
}
}

/**
* ata_eh_about_to_do - about to perform eh_action
* @ap: target ATA port
Expand Down

0 comments on commit af181c2

Please sign in to comment.