Skip to content

Commit

Permalink
target: remove unused codes from enum tcm_tmrsp_table
Browse files Browse the repository at this point in the history
Three have been checked for but were never set.  Remove the dead code.
Also renumbers the remaining ones to a) get rid of the holes after the
removal and b) avoid a collision between TMR_FUNCTION_COMPLETE==0 and
the uninitialized case.  If we failed to set a code, we should rather
fall into the default case then return success.

Signed-off-by: Joern Engel <joern@logfs.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  • Loading branch information
Joern Engel authored and Nicholas Bellinger committed Jul 8, 2013
1 parent ad7babd commit 11fee8a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
2 changes: 0 additions & 2 deletions drivers/target/iscsi/iscsi_target.c
Original file line number Diff line number Diff line change
Expand Up @@ -3286,8 +3286,6 @@ static u8 iscsit_convert_tcm_tmr_rsp(struct se_tmr_req *se_tmr)
return ISCSI_TMF_RSP_NO_LUN;
case TMR_TASK_MGMT_FUNCTION_NOT_SUPPORTED:
return ISCSI_TMF_RSP_NOT_SUPPORTED;
case TMR_FUNCTION_AUTHORIZATION_FAILED:
return ISCSI_TMF_RSP_AUTH_FAILED;
case TMR_FUNCTION_REJECTED:
default:
return ISCSI_TMF_RSP_REJECTED;
Expand Down
3 changes: 0 additions & 3 deletions drivers/target/tcm_fc/tfc_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,7 @@ int ft_queue_tm_resp(struct se_cmd *se_cmd)
code = FCP_TMF_REJECTED;
break;
case TMR_TASK_DOES_NOT_EXIST:
case TMR_TASK_STILL_ALLEGIANT:
case TMR_TASK_FAILOVER_NOT_SUPPORTED:
case TMR_TASK_MGMT_FUNCTION_NOT_SUPPORTED:
case TMR_FUNCTION_AUTHORIZATION_FAILED:
default:
code = FCP_TMF_FAILED;
break;
Expand Down
13 changes: 5 additions & 8 deletions include/target/target_core_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,11 @@ enum tcm_tmreq_table {

/* fabric independent task management response values */
enum tcm_tmrsp_table {
TMR_FUNCTION_COMPLETE = 0,
TMR_TASK_DOES_NOT_EXIST = 1,
TMR_LUN_DOES_NOT_EXIST = 2,
TMR_TASK_STILL_ALLEGIANT = 3,
TMR_TASK_FAILOVER_NOT_SUPPORTED = 4,
TMR_TASK_MGMT_FUNCTION_NOT_SUPPORTED = 5,
TMR_FUNCTION_AUTHORIZATION_FAILED = 6,
TMR_FUNCTION_REJECTED = 255,
TMR_FUNCTION_COMPLETE = 1,
TMR_TASK_DOES_NOT_EXIST = 2,
TMR_LUN_DOES_NOT_EXIST = 3,
TMR_TASK_MGMT_FUNCTION_NOT_SUPPORTED = 4,
TMR_FUNCTION_REJECTED = 5,
};

/*
Expand Down

0 comments on commit 11fee8a

Please sign in to comment.