scsi: core: Declare SCSI host template pointer members const
Declare the SCSI host template pointer members const and also the remaining SCSI host template pointers in the SCSI core. Reviewed-by: Benjamin Block <bblock@linux.ibm.com> Reviewed-by: John Garry <john.g.garry@oracle.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Ming Lei <ming.lei@redhat.com> Cc: Hannes Reinecke <hare@suse.de> Cc: Mike Christie <michael.christie@oracle.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20230322195515.1267197-4-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
31435de974
commit
e0d3f2c694
|
@ -436,7 +436,7 @@ Details::
|
|||
*
|
||||
* Defined in: drivers/scsi/hosts.c .
|
||||
**/
|
||||
struct Scsi_Host * scsi_host_alloc(struct scsi_host_template * sht,
|
||||
struct Scsi_Host * scsi_host_alloc(const struct scsi_host_template * sht,
|
||||
int privsize)
|
||||
|
||||
|
||||
|
|
|
@ -219,7 +219,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",
|
||||
|
@ -392,7 +392,7 @@ static struct device_type scsi_host_type = {
|
|||
* Return value:
|
||||
* Pointer to a new Scsi_Host
|
||||
**/
|
||||
struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
|
||||
struct Scsi_Host *scsi_host_alloc(const struct scsi_host_template *sht, int privsize)
|
||||
{
|
||||
struct Scsi_Host *shost;
|
||||
int index;
|
||||
|
|
|
@ -11,7 +11,7 @@ struct raid_template {
|
|||
};
|
||||
|
||||
struct raid_function_template {
|
||||
void *cookie;
|
||||
const void *cookie;
|
||||
int (*is_raid)(struct device *);
|
||||
void (*get_resync)(struct device *);
|
||||
void (*get_state)(struct device *);
|
||||
|
|
|
@ -866,7 +866,7 @@ static inline void *lport_priv(const struct fc_lport *lport)
|
|||
* Returns: libfc lport
|
||||
*/
|
||||
static inline struct fc_lport *
|
||||
libfc_host_alloc(struct scsi_host_template *sht, int priv_size)
|
||||
libfc_host_alloc(const struct scsi_host_template *sht, int priv_size)
|
||||
{
|
||||
struct fc_lport *lport;
|
||||
struct Scsi_Host *shost;
|
||||
|
|
|
@ -554,7 +554,7 @@ struct Scsi_Host {
|
|||
struct completion * eh_action; /* Wait for specific actions on the
|
||||
host. */
|
||||
wait_queue_head_t host_wait;
|
||||
struct scsi_host_template *hostt;
|
||||
const struct scsi_host_template *hostt;
|
||||
struct scsi_transport_template *transportt;
|
||||
|
||||
struct kref tagset_refcnt;
|
||||
|
@ -747,7 +747,7 @@ static inline int scsi_host_in_recovery(struct Scsi_Host *shost)
|
|||
extern int scsi_queue_work(struct Scsi_Host *, struct work_struct *);
|
||||
extern void scsi_flush_work(struct Scsi_Host *);
|
||||
|
||||
extern struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *, int);
|
||||
extern struct Scsi_Host *scsi_host_alloc(const struct scsi_host_template *, int);
|
||||
extern int __must_check scsi_add_host_with_dma(struct Scsi_Host *,
|
||||
struct device *,
|
||||
struct device *);
|
||||
|
|
Loading…
Reference in New Issue