Skip to content

Commit 62d15db

Browse files
Merge patch series "Constify most SCSI host templates"
Bart Van Assche <bvanassche@acm.org> says: It helps humans and the compiler if it is made explicit that SCSI host templates are not modified. Hence this patch series that constifies most SCSI host templates. Please consider this patch series for the next merge window. Link: https://lore.kernel.org/r/20230322195515.1267197-1-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2 parents 9abb593 + 04d1fa4 commit 62d15db

225 files changed

Lines changed: 268 additions & 270 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/scsi/scsi_mid_low_api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ Details::
436436
*
437437
* Defined in: drivers/scsi/hosts.c .
438438
**/
439-
struct Scsi_Host * scsi_host_alloc(struct scsi_host_template * sht,
439+
struct Scsi_Host * scsi_host_alloc(const struct scsi_host_template * sht,
440440
int privsize)
441441

442442

drivers/ata/acard-ahci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ static int acard_ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg
6666
static int acard_ahci_pci_device_resume(struct pci_dev *pdev);
6767
#endif
6868

69-
static struct scsi_host_template acard_ahci_sht = {
69+
static const struct scsi_host_template acard_ahci_sht = {
7070
AHCI_SHT("acard-ahci"),
7171
};
7272

drivers/ata/ahci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ static int ahci_pci_device_resume(struct device *dev);
101101
#endif
102102
#endif /* CONFIG_PM */
103103

104-
static struct scsi_host_template ahci_sht = {
104+
static const struct scsi_host_template ahci_sht = {
105105
AHCI_SHT("ahci"),
106106
};
107107

drivers/ata/ahci.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ void ahci_set_em_messages(struct ahci_host_priv *hpriv,
430430
struct ata_port_info *pi);
431431
int ahci_reset_em(struct ata_host *host);
432432
void ahci_print_info(struct ata_host *host, const char *scc_s);
433-
int ahci_host_activate(struct ata_host *host, struct scsi_host_template *sht);
433+
int ahci_host_activate(struct ata_host *host, const struct scsi_host_template *sht);
434434
void ahci_error_handler(struct ata_port *ap);
435435
u32 ahci_handle_port_intr(struct ata_host *host, u32 irq_masked);
436436

drivers/ata/ahci_brcm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ static int __maybe_unused brcm_ahci_resume(struct device *dev)
417417
return ret;
418418
}
419419

420-
static struct scsi_host_template ahci_platform_sht = {
420+
static const struct scsi_host_template ahci_platform_sht = {
421421
AHCI_SHT(DRV_NAME),
422422
};
423423

drivers/ata/ahci_ceva.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ static void ahci_ceva_setup(struct ahci_host_priv *hpriv)
185185
}
186186
}
187187

188-
static struct scsi_host_template ahci_platform_sht = {
188+
static const struct scsi_host_template ahci_platform_sht = {
189189
AHCI_SHT(DRV_NAME),
190190
};
191191

drivers/ata/ahci_da850.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ static const struct ata_port_info ahci_da850_port_info = {
153153
.port_ops = &ahci_da850_port_ops,
154154
};
155155

156-
static struct scsi_host_template ahci_platform_sht = {
156+
static const struct scsi_host_template ahci_platform_sht = {
157157
AHCI_SHT(DRV_NAME),
158158
};
159159

drivers/ata/ahci_dm816.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ static const struct ata_port_info ahci_dm816_port_info = {
134134
.port_ops = &ahci_dm816_port_ops,
135135
};
136136

137-
static struct scsi_host_template ahci_dm816_platform_sht = {
137+
static const struct scsi_host_template ahci_dm816_platform_sht = {
138138
AHCI_SHT(AHCI_DM816_DRV_NAME),
139139
};
140140

drivers/ata/ahci_dwc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ static const struct ata_port_info ahci_dwc_port_info = {
398398
.port_ops = &ahci_dwc_port_ops,
399399
};
400400

401-
static struct scsi_host_template ahci_dwc_scsi_info = {
401+
static const struct scsi_host_template ahci_dwc_scsi_info = {
402402
AHCI_SHT(DRV_NAME),
403403
};
404404

drivers/ata/ahci_imx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ static u32 imx_ahci_parse_props(struct device *dev,
979979
return reg_value;
980980
}
981981

982-
static struct scsi_host_template ahci_platform_sht = {
982+
static const struct scsi_host_template ahci_platform_sht = {
983983
AHCI_SHT(DRV_NAME),
984984
};
985985

0 commit comments

Comments
 (0)