Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scsi: pm8001: Cleanup pm8001_exec_internal_task_abort()

Replace the goto statement in the for loop with "break" and remove the
ex_err label. Also fix long lines, identation and blank lines to make the
code more readable.

Link: https://lore.kernel.org/r/20220220031810.738362-25-damien.lemoal@opensource.wdc.com
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Damien Le Moal and committed by
Martin K. Petersen
0c4ad6c3 a1e7c799

+21 -17
+21 -17
drivers/scsi/pm8001/pm8001_sas.c
··· 724 724 task->task_proto = dev->tproto; 725 725 task->task_done = pm8001_task_done; 726 726 task->slow_task->timer.function = pm8001_tmf_timedout; 727 - task->slow_task->timer.expires = jiffies + PM8001_TASK_TIMEOUT * HZ; 727 + task->slow_task->timer.expires = 728 + jiffies + PM8001_TASK_TIMEOUT * HZ; 728 729 add_timer(&task->slow_task->timer); 729 730 730 731 res = pm8001_tag_alloc(pm8001_ha, &ccb_tag); 731 732 if (res) 732 - goto ex_err; 733 + break; 734 + 733 735 ccb = &pm8001_ha->ccb_info[ccb_tag]; 734 736 ccb->device = pm8001_dev; 735 737 ccb->ccb_tag = ccb_tag; 736 738 ccb->task = task; 737 739 ccb->n_elem = 0; 738 740 739 - res = PM8001_CHIP_DISP->task_abort(pm8001_ha, 740 - pm8001_dev, flag, task_tag, ccb_tag); 741 + res = PM8001_CHIP_DISP->task_abort(pm8001_ha, pm8001_dev, flag, 742 + task_tag, ccb_tag); 741 743 if (res) { 742 744 del_timer(&task->slow_task->timer); 743 - pm8001_dbg(pm8001_ha, FAIL, "Executing internal task failed\n"); 745 + pm8001_dbg(pm8001_ha, FAIL, 746 + "Executing internal task failed\n"); 744 747 pm8001_tag_free(pm8001_ha, ccb_tag); 745 - goto ex_err; 748 + break; 746 749 } 750 + 747 751 wait_for_completion(&task->slow_task->completion); 748 752 res = TMF_RESP_FUNC_FAILED; 753 + 749 754 /* Even TMF timed out, return direct. */ 750 755 if (task->task_state_flags & SAS_TASK_STATE_ABORTED) { 751 756 pm8001_dbg(pm8001_ha, FAIL, "TMF task timeout.\n"); 752 - goto ex_err; 757 + break; 753 758 } 754 759 755 760 if (task->task_status.resp == SAS_TASK_COMPLETE && 756 761 task->task_status.stat == SAS_SAM_STAT_GOOD) { 757 762 res = TMF_RESP_FUNC_COMPLETE; 758 763 break; 759 - 760 - } else { 761 - pm8001_dbg(pm8001_ha, EH, 762 - " Task to dev %016llx response: 0x%x status 0x%x\n", 763 - SAS_ADDR(dev->sas_addr), 764 - task->task_status.resp, 765 - task->task_status.stat); 766 - sas_free_task(task); 767 - task = NULL; 768 764 } 765 + 766 + pm8001_dbg(pm8001_ha, EH, 767 + " Task to dev %016llx response: 0x%x status 0x%x\n", 768 + SAS_ADDR(dev->sas_addr), 769 + task->task_status.resp, 770 + task->task_status.stat); 771 + sas_free_task(task); 772 + task = NULL; 769 773 } 770 - ex_err: 774 + 771 775 BUG_ON(retry == 3 && task != NULL); 772 776 sas_free_task(task); 773 777 return res;