Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Joern Engel and committed by
Nicholas Bellinger
b79fafac 11fee8a7

+28 -28
+17 -10
drivers/infiniband/ulp/srpt/ib_srpt.c
··· 3011 3011 * Callback function called by the TCM core. Must not block since it can be 3012 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 3016 struct srpt_rdma_ch *ch; 3017 3017 struct srpt_send_ioctx *ioctx; ··· 3021 3021 enum dma_data_direction dir; 3022 3022 int resp_len; 3023 3023 u8 srp_tm_status; 3024 - 3025 - ret = 0; 3026 3024 3027 3025 ioctx = container_of(cmd, struct srpt_send_ioctx, cmd); 3028 3026 ch = ioctx->ch; ··· 3047 3049 || WARN_ON_ONCE(state == SRPT_STATE_CMD_RSP_SENT))) { 3048 3050 atomic_inc(&ch->req_lim_delta); 3049 3051 srpt_abort_cmd(ioctx); 3050 - goto out; 3052 + return; 3051 3053 } 3052 3054 3053 3055 dir = ioctx->cmd.data_direction; ··· 3059 3061 if (ret) { 3060 3062 printk(KERN_ERR "xfer_data failed for tag %llu\n", 3061 3063 ioctx->tag); 3062 - goto out; 3064 + return; 3063 3065 } 3064 3066 } 3065 3067 ··· 3080 3082 srpt_set_cmd_state(ioctx, SRPT_STATE_DONE); 3081 3083 target_put_sess_cmd(ioctx->ch->sess, &ioctx->cmd); 3082 3084 } 3085 + } 3083 3086 3084 - out: 3085 - return ret; 3087 + static int srpt_queue_data_in(struct se_cmd *cmd) 3088 + { 3089 + srpt_queue_response(cmd); 3090 + return 0; 3091 + } 3092 + 3093 + static void srpt_queue_tm_rsp(struct se_cmd *cmd) 3094 + { 3095 + srpt_queue_response(cmd); 3086 3096 } 3087 3097 3088 3098 static int srpt_queue_status(struct se_cmd *cmd) ··· 3103 3097 (SCF_TRANSPORT_TASK_SENSE | SCF_EMULATED_TASK_SENSE)) 3104 3098 WARN_ON(cmd->scsi_status != SAM_STAT_CHECK_CONDITION); 3105 3099 ioctx->queue_status_only = true; 3106 - return srpt_queue_response(cmd); 3100 + srpt_queue_response(cmd); 3101 + return 0; 3107 3102 } 3108 3103 3109 3104 static void srpt_refresh_port_work(struct work_struct *work) ··· 3937 3930 .set_default_node_attributes = srpt_set_default_node_attrs, 3938 3931 .get_task_tag = srpt_get_task_tag, 3939 3932 .get_cmd_state = srpt_get_tcm_cmd_state, 3940 - .queue_data_in = srpt_queue_response, 3933 + .queue_data_in = srpt_queue_data_in, 3941 3934 .queue_status = srpt_queue_status, 3942 - .queue_tm_rsp = srpt_queue_response, 3935 + .queue_tm_rsp = srpt_queue_tm_rsp, 3943 3936 /* 3944 3937 * Setup function pointers for generic logic in 3945 3938 * target_core_fabric_configfs.c
+1 -3
drivers/scsi/qla2xxx/tcm_qla2xxx.c
··· 699 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 704 struct se_tmr_req *se_tmr = se_cmd->se_tmr_req; 705 705 struct qla_tgt_mgmt_cmd *mcmd = container_of(se_cmd, ··· 731 731 * CTIO response packet. 732 732 */ 733 733 qlt_xmit_tm_rsp(mcmd); 734 - 735 - return 0; 736 734 } 737 735 738 736 /* Local pointer to allocated TCM configfs fabric module */
+1 -2
drivers/target/iscsi/iscsi_target_configfs.c
··· 1790 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 1795 struct iscsi_cmd *cmd = container_of(se_cmd, struct iscsi_cmd, se_cmd); 1796 1796 1797 1797 cmd->i_state = ISTATE_SEND_TASKMGTRSP; 1798 1798 iscsit_add_cmd_to_response_queue(cmd, cmd->conn, cmd->i_state); 1799 - return 0; 1800 1799 } 1801 1800 1802 1801 static char *lio_tpg_get_endpoint_wwn(struct se_portal_group *se_tpg)
+1 -2
drivers/target/loopback/tcm_loop.c
··· 786 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 791 struct se_tmr_req *se_tmr = se_cmd->se_tmr_req; 792 792 struct tcm_loop_tmr *tl_tmr = se_tmr->fabric_tmr_ptr; ··· 796 796 */ 797 797 atomic_set(&tl_tmr->tmr_complete, 1); 798 798 wake_up(&tl_tmr->tl_tmr_wait); 799 - return 0; 800 799 } 801 800 802 801 static char *tcm_loop_dump_proto_id(struct tcm_loop_hba *tl_hba)
+1 -2
drivers/target/sbp/sbp_target.c
··· 1842 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 1849 static int sbp_check_stop_free(struct se_cmd *se_cmd)
+1 -1
drivers/target/tcm_fc/tcm_fc.h
··· 161 161 int ft_write_pending_status(struct se_cmd *); 162 162 u32 ft_get_task_tag(struct se_cmd *); 163 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 167 * other internal functions.
+2 -3
drivers/target/tcm_fc/tfc_cmd.c
··· 394 394 /* 395 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 399 struct ft_cmd *cmd = container_of(se_cmd, struct ft_cmd, se_cmd); 400 400 struct se_tmr_req *tmr = se_cmd->se_tmr_req; 401 401 enum fcp_resp_rsp_codes code; 402 402 403 403 if (cmd->aborted) 404 - return 0; 404 + return; 405 405 switch (tmr->response) { 406 406 case TMR_FUNCTION_COMPLETE: 407 407 code = FCP_TMF_CMPL; ··· 421 421 pr_debug("tmr fn %d resp %d fcp code %d\n", 422 422 tmr->function, tmr->response, code); 423 423 ft_send_resp_code(cmd, code); 424 - return 0; 425 424 } 426 425 427 426 static void ft_send_work(struct work_struct *work);
+1 -2
drivers/usb/gadget/tcm_usb_gadget.c
··· 1467 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 1474 static const char *usbg_check_wwn(const char *name)
+2 -2
drivers/vhost/scsi.c
··· 528 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 536 static void tcm_vhost_free_evt(struct vhost_scsi *vs, struct tcm_vhost_evt *evt)
+1 -1
include/target/target_core_fabric.h
··· 61 61 int (*get_cmd_state)(struct se_cmd *); 62 62 int (*queue_data_in)(struct se_cmd *); 63 63 int (*queue_status)(struct se_cmd *); 64 - int (*queue_tm_rsp)(struct se_cmd *); 64 + void (*queue_tm_rsp)(struct se_cmd *); 65 65 /* 66 66 * fabric module calls for target_core_fabric_configfs.c 67 67 */