diff options
author | Bartosz Barcinski <Bartosz.Barcinski@intel.com> | 2011-04-12 17:28:43 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-07-03 04:00:37 -0700 |
commit | 6cb4d6b382be6345c2d0c4b1b90dfdf9af32da7e (patch) | |
tree | 9d9849a1557888051429a36d4ffa2cbd2dd3591e /drivers/scsi/isci/task.c | |
parent | 467e855a0331f619f41fbf7391bc29ec0ca923a0 (diff) |
isci: audit usage of BUG_ON macro in isci driver
Removes unnecessary usage of BUG_ON macro, excluding core directory.
In some cases macro is unnecesary, check is done in caller function.
In other cases macro is replaced by if construction with
appropriate warning.
Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com>
[changed some survivable bug conditions to WARN_ONCE]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci/task.c')
-rw-r--r-- | drivers/scsi/isci/task.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/scsi/isci/task.c b/drivers/scsi/isci/task.c index b88101e195d..c79968db871 100644 --- a/drivers/scsi/isci/task.c +++ b/drivers/scsi/isci/task.c @@ -272,7 +272,7 @@ static enum sci_status isci_task_request_build( { struct scic_sds_remote_device *sci_device; enum sci_status status = SCI_FAILURE; - struct isci_request *request; + struct isci_request *request = NULL; struct isci_remote_device *isci_device; /* struct sci_sas_identify_address_frame_protocols dev_protocols; */ struct smp_discover_response_protocols dev_protocols; @@ -372,8 +372,6 @@ static void isci_tmf_timeout_cb(void *tmf_request_arg) struct isci_tmf *tmf = isci_request_access_tmf(request); enum sci_status status; - BUG_ON(request->ttype != tmf_task); - /* This task management request has timed-out. Terminate the request * so that the request eventually completes to the requestor in the * request completion callback path. @@ -1121,8 +1119,11 @@ static void isci_abort_task_process_cb( * request state was already set to "aborted" by the abort * task function. */ - BUG_ON((old_request->status != aborted) - && (old_request->status != completed)); + if ((old_request->status != aborted) + && (old_request->status != completed)) + dev_err(&old_request->isci_host->pdev->dev, + "%s: Bad request status (%d): tmf=%p, old_request=%p\n", + __func__, old_request->status, tmf, old_request); break; case isci_tmf_timed_out: |