diff options
author | Joern Engel <joern@logfs.org> | 2013-07-03 11:22:17 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-07-07 21:36:53 -0400 |
commit | b79fafac70fc9bbe640b8193ed772eb850efdfe6 (patch) | |
tree | b99c39999610a4371563ec179d3b2e10a04c2df0 /drivers | |
parent | 11fee8a751670cf6d60b1912e2e9cb1c7e392842 (diff) |
target: make queue_tm_rsp() return void
The return value wasn't checked by any of the callers. Assuming this is
correct behaviour, we can simplify some code by not bothering to
generate it.
nab: Add srpt_queue_data_in() + srpt_queue_tm_rsp() nops around
srpt_queue_response() void return
Signed-off-by: Joern Engel <joern@logfs.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/infiniband/ulp/srpt/ib_srpt.c | 27 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/tcm_qla2xxx.c | 4 | ||||
-rw-r--r-- | drivers/target/iscsi/iscsi_target_configfs.c | 3 | ||||
-rw-r--r-- | drivers/target/loopback/tcm_loop.c | 3 | ||||
-rw-r--r-- | drivers/target/sbp/sbp_target.c | 3 | ||||
-rw-r--r-- | drivers/target/tcm_fc/tcm_fc.h | 2 | ||||
-rw-r--r-- | drivers/target/tcm_fc/tfc_cmd.c | 5 | ||||
-rw-r--r-- | drivers/usb/gadget/tcm_usb_gadget.c | 3 | ||||
-rw-r--r-- | drivers/vhost/scsi.c | 4 |
9 files changed, 27 insertions, 27 deletions
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index 3f3f0416fbdd..653ac6bfc57a 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c | |||
@@ -3011,7 +3011,7 @@ static u8 tcm_to_srp_tsk_mgmt_status(const int tcm_mgmt_status) | |||
3011 | * Callback function called by the TCM core. Must not block since it can be | 3011 | * Callback function called by the TCM core. Must not block since it can be |
3012 | * invoked on the context of the IB completion handler. | 3012 | * invoked on the context of the IB completion handler. |
3013 | */ | 3013 | */ |
3014 | static int srpt_queue_response(struct se_cmd *cmd) | 3014 | static void srpt_queue_response(struct se_cmd *cmd) |
3015 | { | 3015 | { |
3016 | struct srpt_rdma_ch *ch; | 3016 | struct srpt_rdma_ch *ch; |
3017 | struct srpt_send_ioctx *ioctx; | 3017 | struct srpt_send_ioctx *ioctx; |
@@ -3022,8 +3022,6 @@ static int srpt_queue_response(struct se_cmd *cmd) | |||
3022 | int resp_len; | 3022 | int resp_len; |
3023 | u8 srp_tm_status; | 3023 | u8 srp_tm_status; |
3024 | 3024 | ||
3025 | ret = 0; | ||
3026 | |||
3027 | ioctx = container_of(cmd, struct srpt_send_ioctx, cmd); | 3025 | ioctx = container_of(cmd, struct srpt_send_ioctx, cmd); |
3028 | ch = ioctx->ch; | 3026 | ch = ioctx->ch; |
3029 | BUG_ON(!ch); | 3027 | BUG_ON(!ch); |
@@ -3049,7 +3047,7 @@ static int srpt_queue_response(struct se_cmd *cmd) | |||
3049 | || WARN_ON_ONCE(state == SRPT_STATE_CMD_RSP_SENT))) { | 3047 | || WARN_ON_ONCE(state == SRPT_STATE_CMD_RSP_SENT))) { |
3050 | atomic_inc(&ch->req_lim_delta); | 3048 | atomic_inc(&ch->req_lim_delta); |
3051 | srpt_abort_cmd(ioctx); | 3049 | srpt_abort_cmd(ioctx); |
3052 | goto out; | 3050 | return; |
3053 | } | 3051 | } |
3054 | 3052 | ||
3055 | dir = ioctx->cmd.data_direction; | 3053 | dir = ioctx->cmd.data_direction; |
@@ -3061,7 +3059,7 @@ static int srpt_queue_response(struct se_cmd *cmd) | |||
3061 | if (ret) { | 3059 | if (ret) { |
3062 | printk(KERN_ERR "xfer_data failed for tag %llu\n", | 3060 | printk(KERN_ERR "xfer_data failed for tag %llu\n", |
3063 | ioctx->tag); | 3061 | ioctx->tag); |
3064 | goto out; | 3062 | return; |
3065 | } | 3063 | } |
3066 | } | 3064 | } |
3067 | 3065 | ||
@@ -3082,9 +3080,17 @@ static int srpt_queue_response(struct se_cmd *cmd) | |||
3082 | srpt_set_cmd_state(ioctx, SRPT_STATE_DONE); | 3080 | srpt_set_cmd_state(ioctx, SRPT_STATE_DONE); |
3083 | target_put_sess_cmd(ioctx->ch->sess, &ioctx->cmd); | 3081 | target_put_sess_cmd(ioctx->ch->sess, &ioctx->cmd); |
3084 | } | 3082 | } |
3083 | } | ||
3085 | 3084 | ||
3086 | out: | 3085 | static int srpt_queue_data_in(struct se_cmd *cmd) |
3087 | return ret; | 3086 | { |
3087 | srpt_queue_response(cmd); | ||
3088 | return 0; | ||
3089 | } | ||
3090 | |||
3091 | static void srpt_queue_tm_rsp(struct se_cmd *cmd) | ||
3092 | { | ||
3093 | srpt_queue_response(cmd); | ||
3088 | } | 3094 | } |
3089 | 3095 | ||
3090 | static int srpt_queue_status(struct se_cmd *cmd) | 3096 | static int srpt_queue_status(struct se_cmd *cmd) |
@@ -3097,7 +3103,8 @@ static int srpt_queue_status(struct se_cmd *cmd) | |||
3097 | (SCF_TRANSPORT_TASK_SENSE | SCF_EMULATED_TASK_SENSE)) | 3103 | (SCF_TRANSPORT_TASK_SENSE | SCF_EMULATED_TASK_SENSE)) |
3098 | WARN_ON(cmd->scsi_status != SAM_STAT_CHECK_CONDITION); | 3104 | WARN_ON(cmd->scsi_status != SAM_STAT_CHECK_CONDITION); |
3099 | ioctx->queue_status_only = true; | 3105 | ioctx->queue_status_only = true; |
3100 | return srpt_queue_response(cmd); | 3106 | srpt_queue_response(cmd); |
3107 | return 0; | ||
3101 | } | 3108 | } |
3102 | 3109 | ||
3103 | static void srpt_refresh_port_work(struct work_struct *work) | 3110 | static void srpt_refresh_port_work(struct work_struct *work) |
@@ -3930,9 +3937,9 @@ static struct target_core_fabric_ops srpt_template = { | |||
3930 | .set_default_node_attributes = srpt_set_default_node_attrs, | 3937 | .set_default_node_attributes = srpt_set_default_node_attrs, |
3931 | .get_task_tag = srpt_get_task_tag, | 3938 | .get_task_tag = srpt_get_task_tag, |
3932 | .get_cmd_state = srpt_get_tcm_cmd_state, | 3939 | .get_cmd_state = srpt_get_tcm_cmd_state, |
3933 | .queue_data_in = srpt_queue_response, | 3940 | .queue_data_in = srpt_queue_data_in, |
3934 | .queue_status = srpt_queue_status, | 3941 | .queue_status = srpt_queue_status, |
3935 | .queue_tm_rsp = srpt_queue_response, | 3942 | .queue_tm_rsp = srpt_queue_tm_rsp, |
3936 | /* | 3943 | /* |
3937 | * Setup function pointers for generic logic in | 3944 | * Setup function pointers for generic logic in |
3938 | * target_core_fabric_configfs.c | 3945 | * target_core_fabric_configfs.c |
diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c index bb7eb909f0b1..75caa39b807d 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c | |||
@@ -699,7 +699,7 @@ static int tcm_qla2xxx_queue_status(struct se_cmd *se_cmd) | |||
699 | return qlt_xmit_response(cmd, xmit_type, se_cmd->scsi_status); | 699 | return qlt_xmit_response(cmd, xmit_type, se_cmd->scsi_status); |
700 | } | 700 | } |
701 | 701 | ||
702 | static int tcm_qla2xxx_queue_tm_rsp(struct se_cmd *se_cmd) | 702 | static void tcm_qla2xxx_queue_tm_rsp(struct se_cmd *se_cmd) |
703 | { | 703 | { |
704 | struct se_tmr_req *se_tmr = se_cmd->se_tmr_req; | 704 | struct se_tmr_req *se_tmr = se_cmd->se_tmr_req; |
705 | struct qla_tgt_mgmt_cmd *mcmd = container_of(se_cmd, | 705 | struct qla_tgt_mgmt_cmd *mcmd = container_of(se_cmd, |
@@ -731,8 +731,6 @@ static int tcm_qla2xxx_queue_tm_rsp(struct se_cmd *se_cmd) | |||
731 | * CTIO response packet. | 731 | * CTIO response packet. |
732 | */ | 732 | */ |
733 | qlt_xmit_tm_rsp(mcmd); | 733 | qlt_xmit_tm_rsp(mcmd); |
734 | |||
735 | return 0; | ||
736 | } | 734 | } |
737 | 735 | ||
738 | /* Local pointer to allocated TCM configfs fabric module */ | 736 | /* Local pointer to allocated TCM configfs fabric module */ |
diff --git a/drivers/target/iscsi/iscsi_target_configfs.c b/drivers/target/iscsi/iscsi_target_configfs.c index 684d73fcbedf..7d4e19f39fe6 100644 --- a/drivers/target/iscsi/iscsi_target_configfs.c +++ b/drivers/target/iscsi/iscsi_target_configfs.c | |||
@@ -1790,13 +1790,12 @@ static int lio_queue_status(struct se_cmd *se_cmd) | |||
1790 | return 0; | 1790 | return 0; |
1791 | } | 1791 | } |
1792 | 1792 | ||
1793 | static int lio_queue_tm_rsp(struct se_cmd *se_cmd) | 1793 | static void lio_queue_tm_rsp(struct se_cmd *se_cmd) |
1794 | { | 1794 | { |
1795 | struct iscsi_cmd *cmd = container_of(se_cmd, struct iscsi_cmd, se_cmd); | 1795 | struct iscsi_cmd *cmd = container_of(se_cmd, struct iscsi_cmd, se_cmd); |
1796 | 1796 | ||
1797 | cmd->i_state = ISTATE_SEND_TASKMGTRSP; | 1797 | cmd->i_state = ISTATE_SEND_TASKMGTRSP; |
1798 | iscsit_add_cmd_to_response_queue(cmd, cmd->conn, cmd->i_state); | 1798 | iscsit_add_cmd_to_response_queue(cmd, cmd->conn, cmd->i_state); |
1799 | return 0; | ||
1800 | } | 1799 | } |
1801 | 1800 | ||
1802 | static char *lio_tpg_get_endpoint_wwn(struct se_portal_group *se_tpg) | 1801 | static char *lio_tpg_get_endpoint_wwn(struct se_portal_group *se_tpg) |
diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c index 7c908141cc8a..568ad25f25d3 100644 --- a/drivers/target/loopback/tcm_loop.c +++ b/drivers/target/loopback/tcm_loop.c | |||
@@ -786,7 +786,7 @@ static int tcm_loop_queue_status(struct se_cmd *se_cmd) | |||
786 | return 0; | 786 | return 0; |
787 | } | 787 | } |
788 | 788 | ||
789 | static int tcm_loop_queue_tm_rsp(struct se_cmd *se_cmd) | 789 | static void tcm_loop_queue_tm_rsp(struct se_cmd *se_cmd) |
790 | { | 790 | { |
791 | struct se_tmr_req *se_tmr = se_cmd->se_tmr_req; | 791 | struct se_tmr_req *se_tmr = se_cmd->se_tmr_req; |
792 | struct tcm_loop_tmr *tl_tmr = se_tmr->fabric_tmr_ptr; | 792 | struct tcm_loop_tmr *tl_tmr = se_tmr->fabric_tmr_ptr; |
@@ -796,7 +796,6 @@ static int tcm_loop_queue_tm_rsp(struct se_cmd *se_cmd) | |||
796 | */ | 796 | */ |
797 | atomic_set(&tl_tmr->tmr_complete, 1); | 797 | atomic_set(&tl_tmr->tmr_complete, 1); |
798 | wake_up(&tl_tmr->tl_tmr_wait); | 798 | wake_up(&tl_tmr->tl_tmr_wait); |
799 | return 0; | ||
800 | } | 799 | } |
801 | 800 | ||
802 | static char *tcm_loop_dump_proto_id(struct tcm_loop_hba *tl_hba) | 801 | static char *tcm_loop_dump_proto_id(struct tcm_loop_hba *tl_hba) |
diff --git a/drivers/target/sbp/sbp_target.c b/drivers/target/sbp/sbp_target.c index d3536f57444f..e51b09a04d52 100644 --- a/drivers/target/sbp/sbp_target.c +++ b/drivers/target/sbp/sbp_target.c | |||
@@ -1842,9 +1842,8 @@ static int sbp_queue_status(struct se_cmd *se_cmd) | |||
1842 | return sbp_send_sense(req); | 1842 | return sbp_send_sense(req); |
1843 | } | 1843 | } |
1844 | 1844 | ||
1845 | static int sbp_queue_tm_rsp(struct se_cmd *se_cmd) | 1845 | static void sbp_queue_tm_rsp(struct se_cmd *se_cmd) |
1846 | { | 1846 | { |
1847 | return 0; | ||
1848 | } | 1847 | } |
1849 | 1848 | ||
1850 | static int sbp_check_stop_free(struct se_cmd *se_cmd) | 1849 | static int sbp_check_stop_free(struct se_cmd *se_cmd) |
diff --git a/drivers/target/tcm_fc/tcm_fc.h b/drivers/target/tcm_fc/tcm_fc.h index eea69358ced3..0dd54a44abcf 100644 --- a/drivers/target/tcm_fc/tcm_fc.h +++ b/drivers/target/tcm_fc/tcm_fc.h | |||
@@ -161,7 +161,7 @@ int ft_write_pending(struct se_cmd *); | |||
161 | int ft_write_pending_status(struct se_cmd *); | 161 | int ft_write_pending_status(struct se_cmd *); |
162 | u32 ft_get_task_tag(struct se_cmd *); | 162 | u32 ft_get_task_tag(struct se_cmd *); |
163 | int ft_get_cmd_state(struct se_cmd *); | 163 | int ft_get_cmd_state(struct se_cmd *); |
164 | int ft_queue_tm_resp(struct se_cmd *); | 164 | void ft_queue_tm_resp(struct se_cmd *); |
165 | 165 | ||
166 | /* | 166 | /* |
167 | * other internal functions. | 167 | * other internal functions. |
diff --git a/drivers/target/tcm_fc/tfc_cmd.c b/drivers/target/tcm_fc/tfc_cmd.c index 7b6bb72fa475..0e5a1caed176 100644 --- a/drivers/target/tcm_fc/tfc_cmd.c +++ b/drivers/target/tcm_fc/tfc_cmd.c | |||
@@ -394,14 +394,14 @@ static void ft_send_tm(struct ft_cmd *cmd) | |||
394 | /* | 394 | /* |
395 | * Send status from completed task management request. | 395 | * Send status from completed task management request. |
396 | */ | 396 | */ |
397 | int ft_queue_tm_resp(struct se_cmd *se_cmd) | 397 | void ft_queue_tm_resp(struct se_cmd *se_cmd) |
398 | { | 398 | { |
399 | struct ft_cmd *cmd = container_of(se_cmd, struct ft_cmd, se_cmd); | 399 | struct ft_cmd *cmd = container_of(se_cmd, struct ft_cmd, se_cmd); |
400 | struct se_tmr_req *tmr = se_cmd->se_tmr_req; | 400 | struct se_tmr_req *tmr = se_cmd->se_tmr_req; |
401 | enum fcp_resp_rsp_codes code; | 401 | enum fcp_resp_rsp_codes code; |
402 | 402 | ||
403 | if (cmd->aborted) | 403 | if (cmd->aborted) |
404 | return 0; | 404 | return; |
405 | switch (tmr->response) { | 405 | switch (tmr->response) { |
406 | case TMR_FUNCTION_COMPLETE: | 406 | case TMR_FUNCTION_COMPLETE: |
407 | code = FCP_TMF_CMPL; | 407 | code = FCP_TMF_CMPL; |
@@ -421,7 +421,6 @@ int ft_queue_tm_resp(struct se_cmd *se_cmd) | |||
421 | pr_debug("tmr fn %d resp %d fcp code %d\n", | 421 | pr_debug("tmr fn %d resp %d fcp code %d\n", |
422 | tmr->function, tmr->response, code); | 422 | tmr->function, tmr->response, code); |
423 | ft_send_resp_code(cmd, code); | 423 | ft_send_resp_code(cmd, code); |
424 | return 0; | ||
425 | } | 424 | } |
426 | 425 | ||
427 | static void ft_send_work(struct work_struct *work); | 426 | static void ft_send_work(struct work_struct *work); |
diff --git a/drivers/usb/gadget/tcm_usb_gadget.c b/drivers/usb/gadget/tcm_usb_gadget.c index 7cacd6ae818e..0ff33396eef3 100644 --- a/drivers/usb/gadget/tcm_usb_gadget.c +++ b/drivers/usb/gadget/tcm_usb_gadget.c | |||
@@ -1467,9 +1467,8 @@ static int usbg_get_cmd_state(struct se_cmd *se_cmd) | |||
1467 | return 0; | 1467 | return 0; |
1468 | } | 1468 | } |
1469 | 1469 | ||
1470 | static int usbg_queue_tm_rsp(struct se_cmd *se_cmd) | 1470 | static void usbg_queue_tm_rsp(struct se_cmd *se_cmd) |
1471 | { | 1471 | { |
1472 | return 0; | ||
1473 | } | 1472 | } |
1474 | 1473 | ||
1475 | static const char *usbg_check_wwn(const char *name) | 1474 | static const char *usbg_check_wwn(const char *name) |
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index 1e5e82042f84..b35193807f0b 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c | |||
@@ -528,9 +528,9 @@ static int tcm_vhost_queue_status(struct se_cmd *se_cmd) | |||
528 | return 0; | 528 | return 0; |
529 | } | 529 | } |
530 | 530 | ||
531 | static int tcm_vhost_queue_tm_rsp(struct se_cmd *se_cmd) | 531 | static void tcm_vhost_queue_tm_rsp(struct se_cmd *se_cmd) |
532 | { | 532 | { |
533 | return 0; | 533 | return; |
534 | } | 534 | } |
535 | 535 | ||
536 | static void tcm_vhost_free_evt(struct vhost_scsi *vs, struct tcm_vhost_evt *evt) | 536 | static void tcm_vhost_free_evt(struct vhost_scsi *vs, struct tcm_vhost_evt *evt) |