scsi: qla2xxx: Constify struct qla_tgt_func_tmpl
authorBart Van Assche <bvanassche@acm.org>
Sat, 20 Mar 2021 23:23:54 +0000 (16:23 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 25 Mar 2021 01:47:20 +0000 (21:47 -0400)
Since the target function pointers are not modified at runtime, declare the
data structure with the target function pointers const.

Link: https://lore.kernel.org/r/20210320232359.941-3-bvanassche@acm.org
Cc: Quinn Tran <qutran@marvell.com>
Cc: Mike Christie <michael.christie@oracle.com>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Reviewed-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_def.h
drivers/scsi/qla2xxx/tcm_qla2xxx.c

index 49b42b4..3bdf55b 100644 (file)
@@ -3815,7 +3815,7 @@ struct qlt_hw_data {
        __le32 __iomem *atio_q_in;
        __le32 __iomem *atio_q_out;
 
-       struct qla_tgt_func_tmpl *tgt_ops;
+       const struct qla_tgt_func_tmpl *tgt_ops;
        struct qla_tgt_vp_map *tgt_vp_map;
 
        int saved_set;
index 12a2265..e7d3acf 100644 (file)
@@ -1582,7 +1582,7 @@ static void tcm_qla2xxx_update_sess(struct fc_port *sess, port_id_t s_id,
 /*
  * Calls into tcm_qla2xxx used by qla2xxx LLD I/O path.
  */
-static struct qla_tgt_func_tmpl tcm_qla2xxx_template = {
+static const struct qla_tgt_func_tmpl tcm_qla2xxx_template = {
        .find_cmd_by_tag        = tcm_qla2xxx_find_cmd_by_tag,
        .handle_cmd             = tcm_qla2xxx_handle_cmd,
        .handle_data            = tcm_qla2xxx_handle_data,