[SCSI] libsas: don't use made up error codes
authorJames Bottomley <James.Bottomley@HansenPartnership.com>
Sun, 30 Dec 2007 18:37:31 +0000 (12:37 -0600)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Sat, 12 Jan 2008 00:29:15 +0000 (18:29 -0600)
This is bad for two reasons:

     1. If they're returned to outside applications, no-one knows what
        they mean.
     2. Eventually they'll clash with the ever expanding standard error
        codes.

The problem error code in question is ETASK.  I've replaced this by
ECOMM (communications error on send) a network error code that seems to
most closely relay what ETASK meant.

Acked-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/libsas/sas_ata.c
drivers/scsi/libsas/sas_expander.c
include/scsi/libsas.h

index 0829b55c64d23c90cf70b025a566447eed8635f0..adc47d481f97655efd0f34cc278e4ee3931b98b9 100644 (file)
@@ -500,7 +500,7 @@ static int sas_execute_task(struct sas_task *task, void *buffer, int size,
                        goto ex_err;
                }
                wait_for_completion(&task->completion);
-               res = -ETASK;
+               res = -ECOMM;
                if (task->task_state_flags & SAS_TASK_STATE_ABORTED) {
                        int res2;
                        SAS_DPRINTK("task aborted, flags:0x%x\n",
index 8aeaad95242c9bf1efa4d9a6cdb36f22684bad4d..aefd865a578862e3bf17b4a8d6a7f8a4a8aaffef 100644 (file)
@@ -96,7 +96,7 @@ static int smp_execute_task(struct domain_device *dev, void *req, int req_size,
                }
 
                wait_for_completion(&task->completion);
-               res = -ETASK;
+               res = -ECOMM;
                if ((task->task_state_flags & SAS_TASK_STATE_ABORTED)) {
                        SAS_DPRINTK("smp task timed out or aborted\n");
                        i->dft->lldd_abort_task(task);
index 93248cd48373111638b46772a3bbc7a53ddedc73..a075f130303c87f8d066148871704903f65da056 100644 (file)
@@ -91,8 +91,6 @@ enum discover_event {
 
 /* ---------- Expander Devices ---------- */
 
-#define ETASK 0xFA
-
 #define to_dom_device(_obj) container_of(_obj, struct domain_device, dev_obj)
 #define to_dev_attr(_attr)  container_of(_attr, struct domain_dev_attribute,\
                                          attr)