struct urb *cmd_urb;
struct urb *data_in_urb;
struct urb *data_out_urb;
- struct list_head inflight;
- struct list_head dead;
+ struct list_head list;
};
/* I hate forward declarations, but I actually have a loop */
int err;
spin_lock_irqsave(&devinfo->lock, flags);
- list_for_each_entry(cmdinfo, &devinfo->inflight_list, inflight) {
+ list_for_each_entry(cmdinfo, &devinfo->inflight_list, list) {
struct scsi_pointer *scp = (void *)cmdinfo;
struct scsi_cmnd *cmnd = container_of(scp, struct scsi_cmnd,
SCp);
WARN_ON_ONCE(cmdinfo->state & COMMAND_ABORTED);
cmdinfo->state |= COMMAND_ABORTED;
cmdinfo->state &= ~IS_IN_WORK_LIST;
- list_del(&cmdinfo->inflight);
- list_add_tail(&cmdinfo->dead, &devinfo->dead_list);
+ list_move_tail(&cmdinfo->list, &devinfo->dead_list);
}
static void uas_abort_inflight(struct uas_dev_info *devinfo)
unsigned long flags;
spin_lock_irqsave(&devinfo->lock, flags);
- list_for_each_entry_safe(cmdinfo, temp, &devinfo->inflight_list,
- inflight)
+ list_for_each_entry_safe(cmdinfo, temp, &devinfo->inflight_list, list)
uas_mark_cmd_dead(devinfo, cmdinfo, __func__);
spin_unlock_irqrestore(&devinfo->lock, flags);
}
unsigned long flags;
spin_lock_irqsave(&devinfo->lock, flags);
- list_for_each_entry_safe(cmdinfo, temp, &devinfo->dead_list, dead) {
+ list_for_each_entry_safe(cmdinfo, temp, &devinfo->dead_list, list) {
struct scsi_pointer *scp = (void *)cmdinfo;
struct scsi_cmnd *cmnd = container_of(scp, struct scsi_cmnd,
SCp);
if (cmdinfo->state & COMMAND_ABORTED) {
scmd_printk(KERN_INFO, cmnd, "abort completed\n");
cmnd->result = DID_ABORT << 16;
- list_del(&cmdinfo->dead);
- } else
- list_del(&cmdinfo->inflight);
+ }
+ list_del(&cmdinfo->list);
cmnd->scsi_done(cmnd);
return 0;
}
uas_add_work(cmdinfo);
}
- list_add_tail(&cmdinfo->inflight, &devinfo->inflight_list);
+ list_add_tail(&cmdinfo->list, &devinfo->inflight_list);
spin_unlock_irqrestore(&devinfo->lock, flags);
return 0;
}