diff options
author | Jeff Skirvin <jeffrey.d.skirvin@intel.com> | 2011-03-04 17:06:50 -0500 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-07-03 06:55:30 -0400 |
commit | cbb65c665b341e560b7a3b37cc616376031b3ee5 (patch) | |
tree | 2d533723af1cc8895ca95630131f47e9a027d82b | |
parent | f0846c68912545d70da16b2fbedded37ea4394d8 (diff) |
isci: Code review change for completion pointer cleanup.
Since the request structure contains a pointer to the completion to be
used if the request is being aborted or terminated, there is no reason
to pass the completion as a pointer to isci_terminate_request_core().
Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Jacek Danecki <Jacek.Danecki@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r-- | drivers/scsi/isci/task.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/scsi/isci/task.c b/drivers/scsi/isci/task.c index 3dc9ef3f305b..5e80e8449223 100644 --- a/drivers/scsi/isci/task.c +++ b/drivers/scsi/isci/task.c | |||
@@ -677,10 +677,9 @@ static void isci_request_cleanup_completed_loiterer( | |||
677 | static void isci_terminate_request_core( | 677 | static void isci_terminate_request_core( |
678 | struct isci_host *isci_host, | 678 | struct isci_host *isci_host, |
679 | struct isci_remote_device *isci_device, | 679 | struct isci_remote_device *isci_device, |
680 | struct isci_request *isci_request, | 680 | struct isci_request *isci_request) |
681 | struct completion *request_completion) | ||
682 | { | 681 | { |
683 | enum sci_status status = SCI_SUCCESS; | 682 | enum sci_status status = SCI_SUCCESS; |
684 | bool was_terminated = false; | 683 | bool was_terminated = false; |
685 | bool needs_cleanup_handling = false; | 684 | bool needs_cleanup_handling = false; |
686 | enum isci_request_status request_status; | 685 | enum isci_request_status request_status; |
@@ -720,6 +719,7 @@ static void isci_terminate_request_core( | |||
720 | */ | 719 | */ |
721 | if (isci_request->sci_request_handle != NULL) { | 720 | if (isci_request->sci_request_handle != NULL) { |
722 | was_terminated = true; | 721 | was_terminated = true; |
722 | needs_cleanup_handling = true; | ||
723 | status = scic_controller_terminate_request( | 723 | status = scic_controller_terminate_request( |
724 | isci_host->core_controller, | 724 | isci_host->core_controller, |
725 | to_sci_dev(isci_device), | 725 | to_sci_dev(isci_device), |
@@ -744,15 +744,15 @@ static void isci_terminate_request_core( | |||
744 | dev_dbg(&isci_host->pdev->dev, | 744 | dev_dbg(&isci_host->pdev->dev, |
745 | "%s: before completion wait (%p)\n", | 745 | "%s: before completion wait (%p)\n", |
746 | __func__, | 746 | __func__, |
747 | request_completion); | 747 | isci_request->io_request_completion); |
748 | 748 | ||
749 | /* Wait here for the request to complete. */ | 749 | /* Wait here for the request to complete. */ |
750 | wait_for_completion(request_completion); | 750 | wait_for_completion(isci_request->io_request_completion); |
751 | 751 | ||
752 | dev_dbg(&isci_host->pdev->dev, | 752 | dev_dbg(&isci_host->pdev->dev, |
753 | "%s: after completion wait (%p)\n", | 753 | "%s: after completion wait (%p)\n", |
754 | __func__, | 754 | __func__, |
755 | request_completion); | 755 | isci_request->io_request_completion); |
756 | } | 756 | } |
757 | 757 | ||
758 | if (needs_cleanup_handling) | 758 | if (needs_cleanup_handling) |
@@ -760,7 +760,10 @@ static void isci_terminate_request_core( | |||
760 | isci_host, isci_device, isci_request | 760 | isci_host, isci_device, isci_request |
761 | ); | 761 | ); |
762 | } | 762 | } |
763 | /* Clear the completion pointer from the request. */ | ||
764 | isci_request->io_request_completion = NULL; | ||
763 | } | 765 | } |
766 | |||
764 | static void isci_terminate_request( | 767 | static void isci_terminate_request( |
765 | struct isci_host *isci_host, | 768 | struct isci_host *isci_host, |
766 | struct isci_remote_device *isci_device, | 769 | struct isci_remote_device *isci_device, |
@@ -800,7 +803,7 @@ static void isci_terminate_request( | |||
800 | * request and potentially calling up to libsas. | 803 | * request and potentially calling up to libsas. |
801 | */ | 804 | */ |
802 | isci_terminate_request_core(isci_host, isci_device, | 805 | isci_terminate_request_core(isci_host, isci_device, |
803 | isci_request, &request_completion); | 806 | isci_request); |
804 | } | 807 | } |
805 | } | 808 | } |
806 | 809 | ||
@@ -1268,8 +1271,7 @@ int isci_task_abort_task(struct sas_task *task) | |||
1268 | /* Clean up the request on our side, and wait for the aborted I/O to | 1271 | /* Clean up the request on our side, and wait for the aborted I/O to |
1269 | * complete. | 1272 | * complete. |
1270 | */ | 1273 | */ |
1271 | isci_terminate_request_core(isci_host, isci_device, old_request, | 1274 | isci_terminate_request_core(isci_host, isci_device, old_request); |
1272 | &aborted_io_completion); | ||
1273 | } | 1275 | } |
1274 | 1276 | ||
1275 | /* Make sure we do not leave a reference to aborted_io_completion */ | 1277 | /* Make sure we do not leave a reference to aborted_io_completion */ |