From: Andrew Morton Many coding-style fixes... Cc: Robert Hancock Cc: Jeff Garzik Cc: Tejun Heo Cc: Allen Martin Signed-off-by: Andrew Morton --- drivers/ata/sata_nv.c | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff -puN drivers/ata/sata_nv.c~sata_nv-cleanup-adma-error-handling-v2-cleanup drivers/ata/sata_nv.c --- a/drivers/ata/sata_nv.c~sata_nv-cleanup-adma-error-handling-v2-cleanup +++ a/drivers/ata/sata_nv.c @@ -653,34 +653,32 @@ static int nv_adma_check_cpb(struct ata_ VPRINTK("CPB %d, flags=0x%x\n", cpb_num, flags); - if(unlikely((force_err || + if (unlikely((force_err || flags & (NV_CPB_RESP_ATA_ERR | NV_CPB_RESP_CMD_ERR | NV_CPB_RESP_CPB_ERR)))) { struct ata_eh_info *ehi = &ap->eh_info; int freeze = 0; + ata_ehi_clear_desc(ehi); ata_ehi_push_desc(ehi, "CPB resp_flags 0x%x", flags ); - if(flags & NV_CPB_RESP_ATA_ERR) { + if (flags & NV_CPB_RESP_ATA_ERR) { ata_ehi_push_desc(ehi, ": ATA error"); ehi->err_mask |= AC_ERR_DEV; - } - else if(flags & NV_CPB_RESP_CMD_ERR) { + } else if (flags & NV_CPB_RESP_CMD_ERR) { ata_ehi_push_desc(ehi, ": CMD error"); ehi->err_mask |= AC_ERR_DEV; - } - else if(flags & NV_CPB_RESP_CPB_ERR) { + } else if (flags & NV_CPB_RESP_CPB_ERR) { ata_ehi_push_desc(ehi, ": CPB error"); ehi->err_mask |= AC_ERR_SYSTEM; freeze = 1; - } - else { + } else { /* notifier error, but no error in CPB flags? */ ehi->err_mask |= AC_ERR_OTHER; freeze = 1; } /* Kill all commands. EH will determine what actually failed. */ - if(freeze) + if (freeze) ata_port_freeze(ap); else ata_port_abort(ap); @@ -690,11 +688,11 @@ static int nv_adma_check_cpb(struct ata_ if (flags & NV_CPB_RESP_DONE) { struct ata_queued_cmd *qc = ata_qc_from_tag(ap, cpb_num); VPRINTK("CPB flags done, flags=0x%x\n", flags); - if(likely(qc)) { + if (likely(qc)) { /* Grab the ATA port status for non-NCQ commands. For NCQ commands the current status may have nothing to do with the command just completed. */ - if(qc->tf.protocol != ATA_PROT_NCQ) { + if (qc->tf.protocol != ATA_PROT_NCQ) { u8 ata_status = readb(pp->ctl_block + (ATA_REG_STATUS * 4)); qc->err_mask |= ac_err_mask(ata_status); } @@ -789,17 +787,16 @@ static irqreturn_t nv_adma_interrupt(int NV_ADMA_STAT_HOTUNPLUG | NV_ADMA_STAT_TIMEOUT))) { struct ata_eh_info *ehi = &ap->eh_info; + ata_ehi_clear_desc(ehi); ata_ehi_push_desc(ehi, "ADMA status 0x%08x", status ); - if(status & NV_ADMA_STAT_TIMEOUT) { + if (status & NV_ADMA_STAT_TIMEOUT) { ehi->err_mask |= AC_ERR_SYSTEM; ata_ehi_push_desc(ehi, ": timeout"); - } - else if(status & NV_ADMA_STAT_HOTPLUG) { + } else if (status & NV_ADMA_STAT_HOTPLUG) { ata_ehi_hotplugged(ehi); ata_ehi_push_desc(ehi, ": hotplug"); - } - else if(status & NV_ADMA_STAT_HOTUNPLUG) { + } else if (status & NV_ADMA_STAT_HOTUNPLUG) { ata_ehi_hotplugged(ehi); ata_ehi_push_desc(ehi, ": hot unplug"); } @@ -811,14 +808,15 @@ static irqreturn_t nv_adma_interrupt(int NV_ADMA_STAT_CPBERR)) { /** Check CPBs for completed commands */ - if(ata_tag_valid(ap->active_tag)) + if (ata_tag_valid(ap->active_tag)) { /* Non-NCQ command */ nv_adma_check_cpb(ap, ap->active_tag, notifier_error & (1 << ap->active_tag)); - else { + } else { int pos, error = 0; u32 active = ap->sactive; - while( (pos = ffs(active)) && !error) { + + while ((pos = ffs(active)) && !error) { pos--; error = nv_adma_check_cpb(ap, pos, notifier_error & (1 << pos) ); _