Re: [PATCH 2/7] qla2xxx: Constify struct qla_tgt_func_tmpl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> On Mar 15, 2021, at 10:56 PM, Bart Van Assche <bvanassche@xxxxxxx> 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@xxxxxxxxxxx>
> Cc: Mike Christie <michael.christie@xxxxxxxxxx>
> Cc: Himanshu Madhani <himanshu.madhani@xxxxxxxxxx>
> Cc: Daniel Wagner <dwagner@xxxxxxx>
> Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
> ---
> 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,

Looks Good.

Reviewed-by: Himanshu Madhani <himanshu.madhani@xxxxxxxxxx>

--
Himanshu Madhani	 Oracle Linux Engineering





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux