scsi: target: core: Constify enabled() in struct target_opcode_descriptor
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 18 May 2025 18:26:42 +0000 (20:26 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 21 May 2025 02:11:03 +0000 (22:11 -0400)
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>
drivers/target/target_core_spc.c
include/target/target_core_base.h

index 0a02492bef701ca3834ebe87059696f1e384f4d3..07d7eba99cc01e1c6a46e8450f65f18e2571cc86 100644 (file)
@@ -1424,7 +1424,7 @@ static struct target_opcode_descriptor tcm_opcode_write_verify16 = {
        .update_usage_bits = set_dpofua_usage_bits,
 };
 
-static bool tcm_is_ws_enabled(struct target_opcode_descriptor *descr,
+static bool tcm_is_ws_enabled(const struct target_opcode_descriptor *descr,
                              struct se_cmd *cmd)
 {
        struct exec_cmd_ops *ops = cmd->protocol_data;
@@ -1452,7 +1452,7 @@ static struct target_opcode_descriptor tcm_opcode_write_same32 = {
        .update_usage_bits = set_dpofua_usage_bits32,
 };
 
-static bool tcm_is_caw_enabled(struct target_opcode_descriptor *descr,
+static bool tcm_is_caw_enabled(const struct target_opcode_descriptor *descr,
                               struct se_cmd *cmd)
 {
        struct se_device *dev = cmd->se_dev;
@@ -1493,7 +1493,7 @@ static struct target_opcode_descriptor tcm_opcode_read_capacity16 = {
                       0xff, 0xff, 0x00, SCSI_CONTROL_MASK},
 };
 
-static bool tcm_is_rep_ref_enabled(struct target_opcode_descriptor *descr,
+static bool tcm_is_rep_ref_enabled(const struct target_opcode_descriptor *descr,
                                   struct se_cmd *cmd)
 {
        struct se_device *dev = cmd->se_dev;
@@ -1539,7 +1539,7 @@ static struct target_opcode_descriptor tcm_opcode_sync_cache16 = {
                       0xff, 0xff, SCSI_GROUP_NUMBER_MASK, SCSI_CONTROL_MASK},
 };
 
-static bool tcm_is_unmap_enabled(struct target_opcode_descriptor *descr,
+static bool tcm_is_unmap_enabled(const struct target_opcode_descriptor *descr,
                                 struct se_cmd *cmd)
 {
        struct exec_cmd_ops *ops = cmd->protocol_data;
@@ -1662,7 +1662,7 @@ static struct target_opcode_descriptor tcm_opcode_pri_read_resrv = {
                       0xff, SCSI_CONTROL_MASK},
 };
 
-static bool tcm_is_pr_enabled(struct target_opcode_descriptor *descr,
+static bool tcm_is_pr_enabled(const struct target_opcode_descriptor *descr,
                              struct se_cmd *cmd)
 {
        struct se_device *dev = cmd->se_dev;
@@ -1880,7 +1880,7 @@ static struct target_opcode_descriptor tcm_opcode_inquiry = {
                       0xff, SCSI_CONTROL_MASK},
 };
 
-static bool tcm_is_3pc_enabled(struct target_opcode_descriptor *descr,
+static bool tcm_is_3pc_enabled(const struct target_opcode_descriptor *descr,
                               struct se_cmd *cmd)
 {
        struct se_device *dev = cmd->se_dev;
@@ -1942,7 +1942,7 @@ static struct target_opcode_descriptor tcm_opcode_report_target_pgs = {
                       0xff, 0xff, 0x00, SCSI_CONTROL_MASK},
 };
 
-static bool spc_rsoc_enabled(struct target_opcode_descriptor *descr,
+static bool spc_rsoc_enabled(const struct target_opcode_descriptor *descr,
                             struct se_cmd *cmd)
 {
        struct se_device *dev = cmd->se_dev;
@@ -1963,7 +1963,7 @@ static struct target_opcode_descriptor tcm_opcode_report_supp_opcodes = {
        .enabled = spc_rsoc_enabled,
 };
 
-static bool tcm_is_set_tpg_enabled(struct target_opcode_descriptor *descr,
+static bool tcm_is_set_tpg_enabled(const struct target_opcode_descriptor *descr,
                                   struct se_cmd *cmd)
 {
        struct t10_alua_tg_pt_gp *l_tg_pt_gp;
index a52d4967c0d3129b384bd2496583667c8c802c10..c4d9116904aa0f577bb1f4b2194152d99c33507b 100644 (file)
@@ -898,7 +898,7 @@ struct target_opcode_descriptor {
        u8                      specific_timeout;
        u16                     nominal_timeout;
        u16                     recommended_timeout;
-       bool                    (*enabled)(struct target_opcode_descriptor *descr,
+       bool                    (*enabled)(const struct target_opcode_descriptor *descr,
                                           struct se_cmd *cmd);
        void                    (*update_usage_bits)(u8 *usage_bits,
                                                     struct se_device *dev);