diff options
author | kxie@chelsio.com <kxie@chelsio.com> | 2009-12-10 00:25:36 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-12-10 10:45:58 -0500 |
commit | 0109abffbf91b76e2a34e324a407d780a55fc1ab (patch) | |
tree | cf29cd56791116e50b9f73c6b4a4cd0909ef4fdd /drivers | |
parent | 45ca38e753016432a266a18679268a4c4674fb52 (diff) |
[SCSI] cxgb3i: always use negative errno in case of error
Signed-off-by: Karen Xie <kxie@chelsio.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/cxgb3i/cxgb3i_offload.c | 24 | ||||
-rw-r--r-- | drivers/scsi/cxgb3i/cxgb3i_pdu.c | 4 |
2 files changed, 14 insertions, 14 deletions
diff --git a/drivers/scsi/cxgb3i/cxgb3i_offload.c b/drivers/scsi/cxgb3i/cxgb3i_offload.c index c1d5be4adf9c..26ffdcd5a437 100644 --- a/drivers/scsi/cxgb3i/cxgb3i_offload.c +++ b/drivers/scsi/cxgb3i/cxgb3i_offload.c | |||
@@ -291,7 +291,7 @@ static void act_open_req_arp_failure(struct t3cdev *dev, struct sk_buff *skb) | |||
291 | c3cn_hold(c3cn); | 291 | c3cn_hold(c3cn); |
292 | spin_lock_bh(&c3cn->lock); | 292 | spin_lock_bh(&c3cn->lock); |
293 | if (c3cn->state == C3CN_STATE_CONNECTING) | 293 | if (c3cn->state == C3CN_STATE_CONNECTING) |
294 | fail_act_open(c3cn, EHOSTUNREACH); | 294 | fail_act_open(c3cn, -EHOSTUNREACH); |
295 | spin_unlock_bh(&c3cn->lock); | 295 | spin_unlock_bh(&c3cn->lock); |
296 | c3cn_put(c3cn); | 296 | c3cn_put(c3cn); |
297 | __kfree_skb(skb); | 297 | __kfree_skb(skb); |
@@ -792,18 +792,18 @@ static int act_open_rpl_status_to_errno(int status) | |||
792 | { | 792 | { |
793 | switch (status) { | 793 | switch (status) { |
794 | case CPL_ERR_CONN_RESET: | 794 | case CPL_ERR_CONN_RESET: |
795 | return ECONNREFUSED; | 795 | return -ECONNREFUSED; |
796 | case CPL_ERR_ARP_MISS: | 796 | case CPL_ERR_ARP_MISS: |
797 | return EHOSTUNREACH; | 797 | return -EHOSTUNREACH; |
798 | case CPL_ERR_CONN_TIMEDOUT: | 798 | case CPL_ERR_CONN_TIMEDOUT: |
799 | return ETIMEDOUT; | 799 | return -ETIMEDOUT; |
800 | case CPL_ERR_TCAM_FULL: | 800 | case CPL_ERR_TCAM_FULL: |
801 | return ENOMEM; | 801 | return -ENOMEM; |
802 | case CPL_ERR_CONN_EXIST: | 802 | case CPL_ERR_CONN_EXIST: |
803 | cxgb3i_log_error("ACTIVE_OPEN_RPL: 4-tuple in use\n"); | 803 | cxgb3i_log_error("ACTIVE_OPEN_RPL: 4-tuple in use\n"); |
804 | return EADDRINUSE; | 804 | return -EADDRINUSE; |
805 | default: | 805 | default: |
806 | return EIO; | 806 | return -EIO; |
807 | } | 807 | } |
808 | } | 808 | } |
809 | 809 | ||
@@ -817,7 +817,7 @@ static void act_open_retry_timer(unsigned long data) | |||
817 | spin_lock_bh(&c3cn->lock); | 817 | spin_lock_bh(&c3cn->lock); |
818 | skb = alloc_skb(sizeof(struct cpl_act_open_req), GFP_ATOMIC); | 818 | skb = alloc_skb(sizeof(struct cpl_act_open_req), GFP_ATOMIC); |
819 | if (!skb) | 819 | if (!skb) |
820 | fail_act_open(c3cn, ENOMEM); | 820 | fail_act_open(c3cn, -ENOMEM); |
821 | else { | 821 | else { |
822 | skb->sk = (struct sock *)c3cn; | 822 | skb->sk = (struct sock *)c3cn; |
823 | set_arp_failure_handler(skb, act_open_req_arp_failure); | 823 | set_arp_failure_handler(skb, act_open_req_arp_failure); |
@@ -966,14 +966,14 @@ static int abort_status_to_errno(struct s3_conn *c3cn, int abort_reason, | |||
966 | case CPL_ERR_BAD_SYN: /* fall through */ | 966 | case CPL_ERR_BAD_SYN: /* fall through */ |
967 | case CPL_ERR_CONN_RESET: | 967 | case CPL_ERR_CONN_RESET: |
968 | return c3cn->state > C3CN_STATE_ESTABLISHED ? | 968 | return c3cn->state > C3CN_STATE_ESTABLISHED ? |
969 | EPIPE : ECONNRESET; | 969 | -EPIPE : -ECONNRESET; |
970 | case CPL_ERR_XMIT_TIMEDOUT: | 970 | case CPL_ERR_XMIT_TIMEDOUT: |
971 | case CPL_ERR_PERSIST_TIMEDOUT: | 971 | case CPL_ERR_PERSIST_TIMEDOUT: |
972 | case CPL_ERR_FINWAIT2_TIMEDOUT: | 972 | case CPL_ERR_FINWAIT2_TIMEDOUT: |
973 | case CPL_ERR_KEEPALIVE_TIMEDOUT: | 973 | case CPL_ERR_KEEPALIVE_TIMEDOUT: |
974 | return ETIMEDOUT; | 974 | return -ETIMEDOUT; |
975 | default: | 975 | default: |
976 | return EIO; | 976 | return -EIO; |
977 | } | 977 | } |
978 | } | 978 | } |
979 | 979 | ||
@@ -1563,7 +1563,7 @@ free_tid: | |||
1563 | s3_free_atid(cdev, c3cn->tid); | 1563 | s3_free_atid(cdev, c3cn->tid); |
1564 | c3cn->tid = 0; | 1564 | c3cn->tid = 0; |
1565 | out_err: | 1565 | out_err: |
1566 | return -1; | 1566 | return -EINVAL; |
1567 | } | 1567 | } |
1568 | 1568 | ||
1569 | 1569 | ||
diff --git a/drivers/scsi/cxgb3i/cxgb3i_pdu.c b/drivers/scsi/cxgb3i/cxgb3i_pdu.c index 709105071177..1fe3b0f1f3c9 100644 --- a/drivers/scsi/cxgb3i/cxgb3i_pdu.c +++ b/drivers/scsi/cxgb3i/cxgb3i_pdu.c | |||
@@ -388,8 +388,8 @@ int cxgb3i_conn_xmit_pdu(struct iscsi_task *task) | |||
388 | if (err > 0) { | 388 | if (err > 0) { |
389 | int pdulen = err; | 389 | int pdulen = err; |
390 | 390 | ||
391 | cxgb3i_tx_debug("task 0x%p, skb 0x%p, len %u/%u, rv %d.\n", | 391 | cxgb3i_tx_debug("task 0x%p, skb 0x%p, len %u/%u, rv %d.\n", |
392 | task, skb, skb->len, skb->data_len, err); | 392 | task, skb, skb->len, skb->data_len, err); |
393 | 393 | ||
394 | if (task->conn->hdrdgst_en) | 394 | if (task->conn->hdrdgst_en) |
395 | pdulen += ISCSI_DIGEST_SIZE; | 395 | pdulen += ISCSI_DIGEST_SIZE; |