lkml.org 
[lkml]   [2022]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [PATCH 1/4] scsi: core: constify pointer to scsi_host_template
    From
    On 08/04/2022 11:30, Krzysztof Kozlowski wrote:
    > Several pointers to 'struct scsi_host_template' do not modify it, so
    > made them const for safety.
    >

    Is this standard practice? What is so special here?

    Thanks,
    john


    > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
    > ---
    > drivers/scsi/hosts.c | 2 +-
    > drivers/scsi/scsi_error.c | 17 +++++++++--------
    > drivers/scsi/scsi_proc.c | 2 +-
    > drivers/scsi/scsi_sysfs.c | 6 +++---
    > 4 files changed, 14 insertions(+), 13 deletions(-)
    >
    > diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
    > index f69b77cbf538..65616a01761a 100644
    > --- a/drivers/scsi/hosts.c
    > +++ b/drivers/scsi/hosts.c
    > @@ -209,7 +209,7 @@ EXPORT_SYMBOL(scsi_remove_host);
    > int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
    > struct device *dma_dev)
    > {
    > - struct scsi_host_template *sht = shost->hostt;
    > + const struct scsi_host_template *sht = shost->hostt;
    > int error = -EINVAL;
    >
    > shost_printk(KERN_INFO, shost, "%s\n",
    > diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c

    \
     
     \ /
      Last update: 2022-04-08 14:15    [W:4.732 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site