lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2a88a992-641a-b3ff-fe39-7a61fff87cb6@huawei.com>
Date:   Fri, 8 Apr 2022 13:14:08 +0100
From:   John Garry <john.garry@...wei.com>
To:     Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
        "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        Alim Akhtar <alim.akhtar@...sung.com>,
        "Avri Altman" <avri.altman@....com>,
        Doug Gilbert <dgilbert@...erlog.com>,
        <linux-scsi@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/4] scsi: core: constify pointer to scsi_host_template

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@...aro.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ