Skip to content

Commit 11fee8a

Browse files
Joern EngelNicholas Bellinger
authored andcommitted
target: remove unused codes from enum tcm_tmrsp_table
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>
1 parent ad7babd commit 11fee8a

3 files changed

Lines changed: 5 additions & 13 deletions

File tree

‎drivers/target/iscsi/iscsi_target.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3286,8 +3286,6 @@ static u8 iscsit_convert_tcm_tmr_rsp(struct se_tmr_req *se_tmr)
32863286
return ISCSI_TMF_RSP_NO_LUN;
32873287
case TMR_TASK_MGMT_FUNCTION_NOT_SUPPORTED:
32883288
return ISCSI_TMF_RSP_NOT_SUPPORTED;
3289-
case TMR_FUNCTION_AUTHORIZATION_FAILED:
3290-
return ISCSI_TMF_RSP_AUTH_FAILED;
32913289
case TMR_FUNCTION_REJECTED:
32923290
default:
32933291
return ISCSI_TMF_RSP_REJECTED;

‎drivers/target/tcm_fc/tfc_cmd.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,10 +413,7 @@ int ft_queue_tm_resp(struct se_cmd *se_cmd)
413413
code = FCP_TMF_REJECTED;
414414
break;
415415
case TMR_TASK_DOES_NOT_EXIST:
416-
case TMR_TASK_STILL_ALLEGIANT:
417-
case TMR_TASK_FAILOVER_NOT_SUPPORTED:
418416
case TMR_TASK_MGMT_FUNCTION_NOT_SUPPORTED:
419-
case TMR_FUNCTION_AUTHORIZATION_FAILED:
420417
default:
421418
code = FCP_TMF_FAILED;
422419
break;

‎include/target/target_core_base.h‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,11 @@ enum tcm_tmreq_table {
218218

219219
/* fabric independent task management response values */
220220
enum tcm_tmrsp_table {
221-
TMR_FUNCTION_COMPLETE = 0,
222-
TMR_TASK_DOES_NOT_EXIST = 1,
223-
TMR_LUN_DOES_NOT_EXIST = 2,
224-
TMR_TASK_STILL_ALLEGIANT = 3,
225-
TMR_TASK_FAILOVER_NOT_SUPPORTED = 4,
226-
TMR_TASK_MGMT_FUNCTION_NOT_SUPPORTED = 5,
227-
TMR_FUNCTION_AUTHORIZATION_FAILED = 6,
228-
TMR_FUNCTION_REJECTED = 255,
221+
TMR_FUNCTION_COMPLETE = 1,
222+
TMR_TASK_DOES_NOT_EXIST = 2,
223+
TMR_LUN_DOES_NOT_EXIST = 3,
224+
TMR_TASK_MGMT_FUNCTION_NOT_SUPPORTED = 4,
225+
TMR_FUNCTION_REJECTED = 5,
229226
};
230227

231228
/*

0 commit comments

Comments
 (0)