]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
scsi: correct return values for .eh_abort_handler implementations
authorHannes Reinecke <hare@suse.de>
Thu, 30 Oct 2014 08:44:36 +0000 (09:44 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2015 18:00:48 +0000 (10:00 -0800)
commit b6c92b7e0af575e2b8b05bdf33633cf9e1661cbf upstream.

The .eh_abort_handler needs to return SUCCESS, FAILED, or
FAST_IO_FAIL. So fixup all callers to adhere to this requirement.

Reviewed-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/NCR5380.c
drivers/scsi/aha1740.c
drivers/scsi/atari_NCR5380.c
drivers/scsi/esas2r/esas2r_main.c
drivers/scsi/megaraid.c
drivers/scsi/sun3_NCR5380.c

index 1e9d6ad9302b735cf2d124c2c41f053ef4d9f12a..7563b3d9cc768dd1e456bde8290ae94ec17609e2 100644 (file)
@@ -2655,14 +2655,14 @@ static void NCR5380_dma_complete(NCR5380_instance * instance) {
  *
  * Purpose : abort a command
  *
- * Inputs : cmd - the Scsi_Cmnd to abort, code - code to set the 
- *      host byte of the result field to, if zero DID_ABORTED is 
+ * Inputs : cmd - the Scsi_Cmnd to abort, code - code to set the
+ *      host byte of the result field to, if zero DID_ABORTED is
  *      used.
  *
- * Returns : 0 - success, -1 on failure.
+ * Returns : SUCCESS - success, FAILED on failure.
  *
- *     XXX - there is no way to abort the command that is currently 
- *     connected, you have to wait for it to complete.  If this is 
+ *     XXX - there is no way to abort the command that is currently
+ *     connected, you have to wait for it to complete.  If this is
  *     a problem, we could implement longjmp() / setjmp(), setjmp()
  *     called where the loop started in NCR5380_main().
  *
@@ -2712,7 +2712,7 @@ static int NCR5380_abort(Scsi_Cmnd * cmd) {
  * aborted flag and get back into our main loop.
  */
 
-               return 0;
+               return SUCCESS;
        }
 #endif
 
index 5f3101797c93977c98cf047797868df0d00da5c0..31ace4bef8fe98492d47a7134f1192b2d17b6647 100644 (file)
@@ -531,7 +531,7 @@ static int aha1740_eh_abort_handler (Scsi_Cmnd *dummy)
  * quiet as possible...
  */
 
-       return 0;
+       return SUCCESS;
 }
 
 static struct scsi_host_template aha1740_template = {
index 0f3cdbc80ba63a47d59c2e7d07a2cbf3ed67c8a9..30073d43d87b9569ed208fc99919179e7450c869 100644 (file)
@@ -2613,7 +2613,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance)
  *     host byte of the result field to, if zero DID_ABORTED is
  *     used.
  *
- * Returns : 0 - success, -1 on failure.
+ * Returns : SUCCESS - success, FAILED on failure.
  *
  * XXX - there is no way to abort the command that is currently
  *      connected, you have to wait for it to complete.  If this is
index f37f3e3dd5d5af98a3744f74b93761183d847f29..28fe6feae44c90e4c47ce188085b052daa459c55 100644 (file)
@@ -1057,7 +1057,7 @@ int esas2r_eh_abort(struct scsi_cmnd *cmd)
 
                cmd->scsi_done(cmd);
 
-               return 0;
+               return SUCCESS;
        }
 
        spin_lock_irqsave(&a->queue_lock, flags);
index 816db12ef5d555159226c5eb618b110ebb790776..52587ceac099f1769eb2099f5fa86b2c6802a947 100644 (file)
@@ -1967,7 +1967,7 @@ megaraid_abort_and_reset(adapter_t *adapter, Scsi_Cmnd *cmd, int aor)
             cmd->device->id, cmd->device->lun);
 
        if(list_empty(&adapter->pending_list))
-               return FALSE;
+               return FAILED;
 
        list_for_each_safe(pos, next, &adapter->pending_list) {
 
@@ -1990,7 +1990,7 @@ megaraid_abort_and_reset(adapter_t *adapter, Scsi_Cmnd *cmd, int aor)
                                        (aor==SCB_ABORT) ? "ABORTING":"RESET",
                                        scb->idx);
 
-                               return FALSE;
+                               return FAILED;
                        }
                        else {
 
@@ -2015,12 +2015,12 @@ megaraid_abort_and_reset(adapter_t *adapter, Scsi_Cmnd *cmd, int aor)
                                list_add_tail(SCSI_LIST(cmd),
                                                &adapter->completed_list);
 
-                               return TRUE;
+                               return SUCCESS;
                        }
                }
        }
 
-       return FALSE;
+       return FAILED;
 }
 
 static inline int
index 636bbe0ea84cad96705dce323e7a03a0c8859f36..fc57c8aec2b3184610f2eb04bcc7c5c8898646fd 100644 (file)
@@ -2597,15 +2597,15 @@ static void NCR5380_reselect (struct Scsi_Host *instance)
  * Purpose : abort a command
  *
  * Inputs : cmd - the struct scsi_cmnd to abort, code - code to set the
- *     host byte of the result field to, if zero DID_ABORTED is 
+ *     host byte of the result field to, if zero DID_ABORTED is
  *     used.
  *
- * Returns : 0 - success, -1 on failure.
+ * Returns : SUCCESS - success, FAILED on failure.
  *
- * XXX - there is no way to abort the command that is currently 
- *      connected, you have to wait for it to complete.  If this is 
+ * XXX - there is no way to abort the command that is currently
+ *      connected, you have to wait for it to complete.  If this is
  *      a problem, we could implement longjmp() / setjmp(), setjmp()
- *      called where the loop started in NCR5380_main().
+ *      called where the loop started in NCR5380_main().
  */
 
 static int NCR5380_abort(struct scsi_cmnd *cmd)