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

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>

authored by

Joern Engel and committed by
Nicholas Bellinger
11fee8a7 ad7babd2

+5 -13
-2
drivers/target/iscsi/iscsi_target.c
··· 3286 3286 return ISCSI_TMF_RSP_NO_LUN; 3287 3287 case TMR_TASK_MGMT_FUNCTION_NOT_SUPPORTED: 3288 3288 return ISCSI_TMF_RSP_NOT_SUPPORTED; 3289 - case TMR_FUNCTION_AUTHORIZATION_FAILED: 3290 - return ISCSI_TMF_RSP_AUTH_FAILED; 3291 3289 case TMR_FUNCTION_REJECTED: 3292 3290 default: 3293 3291 return ISCSI_TMF_RSP_REJECTED;
-3
drivers/target/tcm_fc/tfc_cmd.c
··· 413 413 code = FCP_TMF_REJECTED; 414 414 break; 415 415 case TMR_TASK_DOES_NOT_EXIST: 416 - case TMR_TASK_STILL_ALLEGIANT: 417 - case TMR_TASK_FAILOVER_NOT_SUPPORTED: 418 416 case TMR_TASK_MGMT_FUNCTION_NOT_SUPPORTED: 419 - case TMR_FUNCTION_AUTHORIZATION_FAILED: 420 417 default: 421 418 code = FCP_TMF_FAILED; 422 419 break;
+5 -8
include/target/target_core_base.h
··· 218 218 219 219 /* fabric independent task management response values */ 220 220 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, 229 226 }; 230 227 231 228 /*