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/infiniband/ulp/srpt | |
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/infiniband/ulp/srpt')
-rw-r--r-- | drivers/infiniband/ulp/srpt/ib_srpt.c | 27 |
1 files changed, 17 insertions, 10 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 |