Skip to content

Commit 7f0047c

Browse files
tititiou36martinkpetersen
authored andcommitted
scsi: target: core: Constify enabled() in struct target_opcode_descriptor
Constify the first argument of the enabled() function in struct target_opcode_descriptor. This is the first step in order to constify struct target_opcode_descriptor. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/4290cf1dbe100c1b1edf2ede5e5aef19b04ee7f2.1747592774.git.christophe.jaillet@wanadoo.fr Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 0c52f62 commit 7f0047c

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

drivers/target/target_core_spc.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,7 +1424,7 @@ static struct target_opcode_descriptor tcm_opcode_write_verify16 = {
14241424
.update_usage_bits = set_dpofua_usage_bits,
14251425
};
14261426

1427-
static bool tcm_is_ws_enabled(struct target_opcode_descriptor *descr,
1427+
static bool tcm_is_ws_enabled(const struct target_opcode_descriptor *descr,
14281428
struct se_cmd *cmd)
14291429
{
14301430
struct exec_cmd_ops *ops = cmd->protocol_data;
@@ -1452,7 +1452,7 @@ static struct target_opcode_descriptor tcm_opcode_write_same32 = {
14521452
.update_usage_bits = set_dpofua_usage_bits32,
14531453
};
14541454

1455-
static bool tcm_is_caw_enabled(struct target_opcode_descriptor *descr,
1455+
static bool tcm_is_caw_enabled(const struct target_opcode_descriptor *descr,
14561456
struct se_cmd *cmd)
14571457
{
14581458
struct se_device *dev = cmd->se_dev;
@@ -1493,7 +1493,7 @@ static struct target_opcode_descriptor tcm_opcode_read_capacity16 = {
14931493
0xff, 0xff, 0x00, SCSI_CONTROL_MASK},
14941494
};
14951495

1496-
static bool tcm_is_rep_ref_enabled(struct target_opcode_descriptor *descr,
1496+
static bool tcm_is_rep_ref_enabled(const struct target_opcode_descriptor *descr,
14971497
struct se_cmd *cmd)
14981498
{
14991499
struct se_device *dev = cmd->se_dev;
@@ -1539,7 +1539,7 @@ static struct target_opcode_descriptor tcm_opcode_sync_cache16 = {
15391539
0xff, 0xff, SCSI_GROUP_NUMBER_MASK, SCSI_CONTROL_MASK},
15401540
};
15411541

1542-
static bool tcm_is_unmap_enabled(struct target_opcode_descriptor *descr,
1542+
static bool tcm_is_unmap_enabled(const struct target_opcode_descriptor *descr,
15431543
struct se_cmd *cmd)
15441544
{
15451545
struct exec_cmd_ops *ops = cmd->protocol_data;
@@ -1662,7 +1662,7 @@ static struct target_opcode_descriptor tcm_opcode_pri_read_resrv = {
16621662
0xff, SCSI_CONTROL_MASK},
16631663
};
16641664

1665-
static bool tcm_is_pr_enabled(struct target_opcode_descriptor *descr,
1665+
static bool tcm_is_pr_enabled(const struct target_opcode_descriptor *descr,
16661666
struct se_cmd *cmd)
16671667
{
16681668
struct se_device *dev = cmd->se_dev;
@@ -1880,7 +1880,7 @@ static struct target_opcode_descriptor tcm_opcode_inquiry = {
18801880
0xff, SCSI_CONTROL_MASK},
18811881
};
18821882

1883-
static bool tcm_is_3pc_enabled(struct target_opcode_descriptor *descr,
1883+
static bool tcm_is_3pc_enabled(const struct target_opcode_descriptor *descr,
18841884
struct se_cmd *cmd)
18851885
{
18861886
struct se_device *dev = cmd->se_dev;
@@ -1942,7 +1942,7 @@ static struct target_opcode_descriptor tcm_opcode_report_target_pgs = {
19421942
0xff, 0xff, 0x00, SCSI_CONTROL_MASK},
19431943
};
19441944

1945-
static bool spc_rsoc_enabled(struct target_opcode_descriptor *descr,
1945+
static bool spc_rsoc_enabled(const struct target_opcode_descriptor *descr,
19461946
struct se_cmd *cmd)
19471947
{
19481948
struct se_device *dev = cmd->se_dev;
@@ -1963,7 +1963,7 @@ static struct target_opcode_descriptor tcm_opcode_report_supp_opcodes = {
19631963
.enabled = spc_rsoc_enabled,
19641964
};
19651965

1966-
static bool tcm_is_set_tpg_enabled(struct target_opcode_descriptor *descr,
1966+
static bool tcm_is_set_tpg_enabled(const struct target_opcode_descriptor *descr,
19671967
struct se_cmd *cmd)
19681968
{
19691969
struct t10_alua_tg_pt_gp *l_tg_pt_gp;

include/target/target_core_base.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ struct target_opcode_descriptor {
898898
u8 specific_timeout;
899899
u16 nominal_timeout;
900900
u16 recommended_timeout;
901-
bool (*enabled)(struct target_opcode_descriptor *descr,
901+
bool (*enabled)(const struct target_opcode_descriptor *descr,
902902
struct se_cmd *cmd);
903903
void (*update_usage_bits)(u8 *usage_bits,
904904
struct se_device *dev);

0 commit comments

Comments
 (0)