Message ID | 20210318032840.7611-3-bvanassche@acm.org (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | qla2xxx patches for kernel v5.12 and v5.13 | expand |
On 3/17/21 8:28 PM, Bart Van Assche wrote: > Since the target function pointers are not modified at runtime, declare > the data structure with the target function pointers const. > > 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> > Signed-off-by: Bart Van Assche <bvanassche@acm.org> > --- > drivers/scsi/qla2xxx/qla_def.h | 2 +- > drivers/scsi/qla2xxx/tcm_qla2xxx.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h > index 49b42b430df4..3bdf55bb0833 100644 > --- a/drivers/scsi/qla2xxx/qla_def.h > +++ b/drivers/scsi/qla2xxx/qla_def.h > @@ -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; > diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c > index 15650a0bde09..46111f031be9 100644 > --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c > +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c > @@ -1578,7 +1578,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, > Reviewed-by: Lee Duncan <lduncan@suse.com>
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 49b42b430df4..3bdf55bb0833 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -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; diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c index 15650a0bde09..46111f031be9 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c @@ -1578,7 +1578,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,