Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: ata: Declare SCSI host templates const

Make it explicit that ATA host templates are not modified.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Serge Semin <fancer.lancer@gmail.com> (for DWC AHCI SATA)
Reviewed-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com> (for Tegra)
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20230322195515.1267197-5-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Bart Van Assche and committed by
Martin K. Petersen
25df73d9 e0d3f2c6

+129 -129
+1 -1
drivers/ata/acard-ahci.c
··· 66 66 static int acard_ahci_pci_device_resume(struct pci_dev *pdev); 67 67 #endif 68 68 69 - static struct scsi_host_template acard_ahci_sht = { 69 + static const struct scsi_host_template acard_ahci_sht = { 70 70 AHCI_SHT("acard-ahci"), 71 71 }; 72 72
+1 -1
drivers/ata/ahci.c
··· 101 101 #endif 102 102 #endif /* CONFIG_PM */ 103 103 104 - static struct scsi_host_template ahci_sht = { 104 + static const struct scsi_host_template ahci_sht = { 105 105 AHCI_SHT("ahci"), 106 106 }; 107 107
+1 -1
drivers/ata/ahci.h
··· 430 430 struct ata_port_info *pi); 431 431 int ahci_reset_em(struct ata_host *host); 432 432 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); 434 434 void ahci_error_handler(struct ata_port *ap); 435 435 u32 ahci_handle_port_intr(struct ata_host *host, u32 irq_masked); 436 436
+1 -1
drivers/ata/ahci_brcm.c
··· 417 417 return ret; 418 418 } 419 419 420 - static struct scsi_host_template ahci_platform_sht = { 420 + static const struct scsi_host_template ahci_platform_sht = { 421 421 AHCI_SHT(DRV_NAME), 422 422 }; 423 423
+1 -1
drivers/ata/ahci_ceva.c
··· 185 185 } 186 186 } 187 187 188 - static struct scsi_host_template ahci_platform_sht = { 188 + static const struct scsi_host_template ahci_platform_sht = { 189 189 AHCI_SHT(DRV_NAME), 190 190 }; 191 191
+1 -1
drivers/ata/ahci_da850.c
··· 153 153 .port_ops = &ahci_da850_port_ops, 154 154 }; 155 155 156 - static struct scsi_host_template ahci_platform_sht = { 156 + static const struct scsi_host_template ahci_platform_sht = { 157 157 AHCI_SHT(DRV_NAME), 158 158 }; 159 159
+1 -1
drivers/ata/ahci_dm816.c
··· 134 134 .port_ops = &ahci_dm816_port_ops, 135 135 }; 136 136 137 - static struct scsi_host_template ahci_dm816_platform_sht = { 137 + static const struct scsi_host_template ahci_dm816_platform_sht = { 138 138 AHCI_SHT(AHCI_DM816_DRV_NAME), 139 139 }; 140 140
+1 -1
drivers/ata/ahci_dwc.c
··· 398 398 .port_ops = &ahci_dwc_port_ops, 399 399 }; 400 400 401 - static struct scsi_host_template ahci_dwc_scsi_info = { 401 + static const struct scsi_host_template ahci_dwc_scsi_info = { 402 402 AHCI_SHT(DRV_NAME), 403 403 }; 404 404
+1 -1
drivers/ata/ahci_imx.c
··· 979 979 return reg_value; 980 980 } 981 981 982 - static struct scsi_host_template ahci_platform_sht = { 982 + static const struct scsi_host_template ahci_platform_sht = { 983 983 AHCI_SHT(DRV_NAME), 984 984 }; 985 985
+1 -1
drivers/ata/ahci_mtk.c
··· 37 37 .port_ops = &ahci_platform_ops, 38 38 }; 39 39 40 - static struct scsi_host_template ahci_platform_sht = { 40 + static const struct scsi_host_template ahci_platform_sht = { 41 41 AHCI_SHT(DRV_NAME), 42 42 }; 43 43
+1 -1
drivers/ata/ahci_mvebu.c
··· 178 178 .port_ops = &ahci_platform_ops, 179 179 }; 180 180 181 - static struct scsi_host_template ahci_platform_sht = { 181 + static const struct scsi_host_template ahci_platform_sht = { 182 182 AHCI_SHT(DRV_NAME), 183 183 }; 184 184
+1 -1
drivers/ata/ahci_platform.c
··· 36 36 .port_ops = &ahci_platform_ops, 37 37 }; 38 38 39 - static struct scsi_host_template ahci_platform_sht = { 39 + static const struct scsi_host_template ahci_platform_sht = { 40 40 AHCI_SHT(DRV_NAME), 41 41 }; 42 42
+1 -1
drivers/ata/ahci_qoriq.c
··· 159 159 .port_ops = &ahci_qoriq_ops, 160 160 }; 161 161 162 - static struct scsi_host_template ahci_qoriq_sht = { 162 + static const struct scsi_host_template ahci_qoriq_sht = { 163 163 AHCI_SHT(DRV_NAME), 164 164 }; 165 165
+1 -1
drivers/ata/ahci_seattle.c
··· 72 72 .port_ops = &ahci_seattle_ops, 73 73 }; 74 74 75 - static struct scsi_host_template ahci_platform_sht = { 75 + static const struct scsi_host_template ahci_platform_sht = { 76 76 AHCI_SHT(DRV_NAME), 77 77 }; 78 78
+1 -1
drivers/ata/ahci_st.c
··· 138 138 .port_ops = &st_ahci_port_ops, 139 139 }; 140 140 141 - static struct scsi_host_template ahci_platform_sht = { 141 + static const struct scsi_host_template ahci_platform_sht = { 142 142 AHCI_SHT(DRV_NAME), 143 143 }; 144 144
+1 -1
drivers/ata/ahci_sunxi.c
··· 206 206 .port_ops = &ahci_platform_ops, 207 207 }; 208 208 209 - static struct scsi_host_template ahci_platform_sht = { 209 + static const struct scsi_host_template ahci_platform_sht = { 210 210 AHCI_SHT(DRV_NAME), 211 211 }; 212 212
+1 -1
drivers/ata/ahci_tegra.c
··· 506 506 }; 507 507 MODULE_DEVICE_TABLE(of, tegra_ahci_of_match); 508 508 509 - static struct scsi_host_template ahci_platform_sht = { 509 + static const struct scsi_host_template ahci_platform_sht = { 510 510 AHCI_SHT(DRV_NAME), 511 511 }; 512 512
+1 -1
drivers/ata/ahci_xgene.c
··· 710 710 return val & CFG_SATA_ENET_SELECT_MASK ? -1 : 0; 711 711 } 712 712 713 - static struct scsi_host_template ahci_platform_sht = { 713 + static const struct scsi_host_template ahci_platform_sht = { 714 714 AHCI_SHT(DRV_NAME), 715 715 }; 716 716
+1 -1
drivers/ata/ata_generic.c
··· 95 95 return 0; 96 96 } 97 97 98 - static struct scsi_host_template generic_sht = { 98 + static const struct scsi_host_template generic_sht = { 99 99 ATA_BMDMA_SHT(DRV_NAME), 100 100 }; 101 101
+3 -3
drivers/ata/ata_piix.c
··· 1059 1059 return ata_bmdma_status(ap) & ~ATA_DMA_ERR; 1060 1060 } 1061 1061 1062 - static struct scsi_host_template piix_sht = { 1062 + static const struct scsi_host_template piix_sht = { 1063 1063 ATA_BMDMA_SHT(DRV_NAME), 1064 1064 }; 1065 1065 ··· 1095 1095 1096 1096 ATTRIBUTE_GROUPS(piix_sidpr_shost); 1097 1097 1098 - static struct scsi_host_template piix_sidpr_sht = { 1098 + static const struct scsi_host_template piix_sidpr_sht = { 1099 1099 ATA_BMDMA_SHT(DRV_NAME), 1100 1100 .shost_groups = piix_sidpr_shost_groups, 1101 1101 }; ··· 1645 1645 struct device *dev = &pdev->dev; 1646 1646 struct ata_port_info port_info[2]; 1647 1647 const struct ata_port_info *ppi[] = { &port_info[0], &port_info[1] }; 1648 - struct scsi_host_template *sht = &piix_sht; 1648 + const struct scsi_host_template *sht = &piix_sht; 1649 1649 unsigned long port_flags; 1650 1650 struct ata_host *host; 1651 1651 struct piix_host_priv *hpriv;
+2 -2
drivers/ata/libahci.c
··· 2692 2692 EXPORT_SYMBOL_GPL(ahci_set_em_messages); 2693 2693 2694 2694 static int ahci_host_activate_multi_irqs(struct ata_host *host, 2695 - struct scsi_host_template *sht) 2695 + const struct scsi_host_template *sht) 2696 2696 { 2697 2697 struct ahci_host_priv *hpriv = host->private_data; 2698 2698 int i, rc; ··· 2736 2736 * RETURNS: 2737 2737 * 0 on success, -errno otherwise. 2738 2738 */ 2739 - int ahci_host_activate(struct ata_host *host, struct scsi_host_template *sht) 2739 + int ahci_host_activate(struct ata_host *host, const struct scsi_host_template *sht) 2740 2740 { 2741 2741 struct ahci_host_priv *hpriv = host->private_data; 2742 2742 int irq = hpriv->irq;
+1 -1
drivers/ata/libahci_platform.c
··· 680 680 int ahci_platform_init_host(struct platform_device *pdev, 681 681 struct ahci_host_priv *hpriv, 682 682 const struct ata_port_info *pi_template, 683 - struct scsi_host_template *sht) 683 + const struct scsi_host_template *sht) 684 684 { 685 685 struct device *dev = &pdev->dev; 686 686 struct ata_port_info pi = *pi_template;
+2 -2
drivers/ata/libata-core.c
··· 5775 5775 * RETURNS: 5776 5776 * 0 on success, -errno otherwise. 5777 5777 */ 5778 - int ata_host_register(struct ata_host *host, struct scsi_host_template *sht) 5778 + int ata_host_register(struct ata_host *host, const struct scsi_host_template *sht) 5779 5779 { 5780 5780 int i, rc; 5781 5781 ··· 5883 5883 */ 5884 5884 int ata_host_activate(struct ata_host *host, int irq, 5885 5885 irq_handler_t irq_handler, unsigned long irq_flags, 5886 - struct scsi_host_template *sht) 5886 + const struct scsi_host_template *sht) 5887 5887 { 5888 5888 int i, rc; 5889 5889 char *irq_desc;
+1 -1
drivers/ata/libata-scsi.c
··· 4186 4186 scsi_done(cmd); 4187 4187 } 4188 4188 4189 - int ata_scsi_add_hosts(struct ata_host *host, struct scsi_host_template *sht) 4189 + int ata_scsi_add_hosts(struct ata_host *host, const struct scsi_host_template *sht) 4190 4190 { 4191 4191 int i, rc; 4192 4192
+4 -4
drivers/ata/libata-sff.c
··· 2281 2281 */ 2282 2282 int ata_pci_sff_activate_host(struct ata_host *host, 2283 2283 irq_handler_t irq_handler, 2284 - struct scsi_host_template *sht) 2284 + const struct scsi_host_template *sht) 2285 2285 { 2286 2286 struct device *dev = host->dev; 2287 2287 struct pci_dev *pdev = to_pci_dev(dev); ··· 2378 2378 2379 2379 static int ata_pci_init_one(struct pci_dev *pdev, 2380 2380 const struct ata_port_info * const *ppi, 2381 - struct scsi_host_template *sht, void *host_priv, 2381 + const struct scsi_host_template *sht, void *host_priv, 2382 2382 int hflags, bool bmdma) 2383 2383 { 2384 2384 struct device *dev = &pdev->dev; ··· 2452 2452 */ 2453 2453 int ata_pci_sff_init_one(struct pci_dev *pdev, 2454 2454 const struct ata_port_info * const *ppi, 2455 - struct scsi_host_template *sht, void *host_priv, int hflag) 2455 + const struct scsi_host_template *sht, void *host_priv, int hflag) 2456 2456 { 2457 2457 return ata_pci_init_one(pdev, ppi, sht, host_priv, hflag, 0); 2458 2458 } ··· 3175 3175 */ 3176 3176 int ata_pci_bmdma_init_one(struct pci_dev *pdev, 3177 3177 const struct ata_port_info * const * ppi, 3178 - struct scsi_host_template *sht, void *host_priv, 3178 + const struct scsi_host_template *sht, void *host_priv, 3179 3179 int hflags) 3180 3180 { 3181 3181 return ata_pci_init_one(pdev, ppi, sht, host_priv, hflags, 1);
+1 -1
drivers/ata/libata.h
··· 111 111 extern struct ata_device *ata_scsi_find_dev(struct ata_port *ap, 112 112 const struct scsi_device *scsidev); 113 113 extern int ata_scsi_add_hosts(struct ata_host *host, 114 - struct scsi_host_template *sht); 114 + const struct scsi_host_template *sht); 115 115 extern void ata_scsi_scan_host(struct ata_port *ap, int sync); 116 116 extern int ata_scsi_offline_dev(struct ata_device *dev); 117 117 extern bool ata_scsi_sense_is_valid(u8 sk, u8 asc, u8 ascq);
+1 -1
drivers/ata/pata_acpi.c
··· 205 205 return ata_bmdma_port_start(ap); 206 206 } 207 207 208 - static struct scsi_host_template pacpi_sht = { 208 + static const struct scsi_host_template pacpi_sht = { 209 209 ATA_BMDMA_SHT(DRV_NAME), 210 210 }; 211 211
+1 -1
drivers/ata/pata_ali.c
··· 355 355 ata_sff_postreset(link, classes); 356 356 } 357 357 358 - static struct scsi_host_template ali_sht = { 358 + static const struct scsi_host_template ali_sht = { 359 359 ATA_BMDMA_SHT(DRV_NAME), 360 360 }; 361 361
+1 -1
drivers/ata/pata_amd.c
··· 388 388 pci_write_config_dword(to_pci_dev(host->dev), 0x60, udma); 389 389 } 390 390 391 - static struct scsi_host_template amd_sht = { 391 + static const struct scsi_host_template amd_sht = { 392 392 ATA_BMDMA_SHT(DRV_NAME), 393 393 }; 394 394
+1 -1
drivers/ata/pata_arasan_cf.c
··· 218 218 struct ata_queued_cmd *qc; 219 219 }; 220 220 221 - static struct scsi_host_template arasan_cf_sht = { 221 + static const struct scsi_host_template arasan_cf_sht = { 222 222 ATA_BASE_SHT(DRIVER_NAME), 223 223 .dma_boundary = 0xFFFFFFFFUL, 224 224 };
+1 -1
drivers/ata/pata_artop.c
··· 292 292 return 0; 293 293 } 294 294 295 - static struct scsi_host_template artop_sht = { 295 + static const struct scsi_host_template artop_sht = { 296 296 ATA_BMDMA_SHT(DRV_NAME), 297 297 }; 298 298
+1 -1
drivers/ata/pata_atiixp.c
··· 251 251 ata_bmdma_stop(qc); 252 252 } 253 253 254 - static struct scsi_host_template atiixp_sht = { 254 + static const struct scsi_host_template atiixp_sht = { 255 255 ATA_BASE_SHT(DRV_NAME), 256 256 .sg_tablesize = LIBATA_DUMB_MAX_PRD, 257 257 .dma_boundary = ATA_DMA_BOUNDARY,
+1 -1
drivers/ata/pata_atp867x.c
··· 259 259 return ATA_CBL_PATA_UNK; 260 260 } 261 261 262 - static struct scsi_host_template atp867x_sht = { 262 + static const struct scsi_host_template atp867x_sht = { 263 263 ATA_BMDMA_SHT(DRV_NAME), 264 264 }; 265 265
+1 -1
drivers/ata/pata_buddha.c
··· 57 57 XSURF_BASE1, XSURF_BASE2 58 58 }; 59 59 60 - static struct scsi_host_template pata_buddha_sht = { 60 + static const struct scsi_host_template pata_buddha_sht = { 61 61 ATA_PIO_SHT(DRV_NAME), 62 62 }; 63 63
+1 -1
drivers/ata/pata_cmd640.c
··· 172 172 return irq_stat & irq_mask; 173 173 } 174 174 175 - static struct scsi_host_template cmd640_sht = { 175 + static const struct scsi_host_template cmd640_sht = { 176 176 ATA_PIO_SHT(DRV_NAME), 177 177 }; 178 178
+1 -1
drivers/ata/pata_cmd64x.c
··· 319 319 ata_bmdma_stop(qc); 320 320 } 321 321 322 - static struct scsi_host_template cmd64x_sht = { 322 + static const struct scsi_host_template cmd64x_sht = { 323 323 ATA_BMDMA_SHT(DRV_NAME), 324 324 }; 325 325
+1 -1
drivers/ata/pata_cs5520.c
··· 94 94 cs5520_set_timings(ap, adev, adev->pio_mode); 95 95 } 96 96 97 - static struct scsi_host_template cs5520_sht = { 97 + static const struct scsi_host_template cs5520_sht = { 98 98 ATA_BASE_SHT(DRV_NAME), 99 99 .sg_tablesize = LIBATA_DUMB_MAX_PRD, 100 100 .dma_boundary = ATA_DMA_BOUNDARY,
+1 -1
drivers/ata/pata_cs5530.c
··· 146 146 return ata_bmdma_qc_issue(qc); 147 147 } 148 148 149 - static struct scsi_host_template cs5530_sht = { 149 + static const struct scsi_host_template cs5530_sht = { 150 150 ATA_BASE_SHT(DRV_NAME), 151 151 .sg_tablesize = LIBATA_DUMB_MAX_PRD, 152 152 .dma_boundary = ATA_DMA_BOUNDARY,
+1 -1
drivers/ata/pata_cs5535.c
··· 141 141 wrmsr(ATAC_CH0D0_DMA + 2 * adev->devno, reg, 0); 142 142 } 143 143 144 - static struct scsi_host_template cs5535_sht = { 144 + static const struct scsi_host_template cs5535_sht = { 145 145 ATA_BMDMA_SHT(DRV_NAME), 146 146 }; 147 147
+1 -1
drivers/ata/pata_cs5536.c
··· 217 217 cs5536_write(pdev, ETC, etc); 218 218 } 219 219 220 - static struct scsi_host_template cs5536_sht = { 220 + static const struct scsi_host_template cs5536_sht = { 221 221 ATA_BMDMA_SHT(DRV_NAME), 222 222 }; 223 223
+1 -1
drivers/ata/pata_cypress.c
··· 115 115 outb(0x50, 0x23); 116 116 } 117 117 118 - static struct scsi_host_template cy82c693_sht = { 118 + static const struct scsi_host_template cy82c693_sht = { 119 119 ATA_BMDMA_SHT(DRV_NAME), 120 120 }; 121 121
+1 -1
drivers/ata/pata_efar.c
··· 234 234 spin_unlock_irqrestore(&efar_lock, flags); 235 235 } 236 236 237 - static struct scsi_host_template efar_sht = { 237 + static const struct scsi_host_template efar_sht = { 238 238 ATA_BMDMA_SHT(DRV_NAME), 239 239 }; 240 240
+1 -1
drivers/ata/pata_ep93xx.c
··· 872 872 return 0; 873 873 } 874 874 875 - static struct scsi_host_template ep93xx_pata_sht = { 875 + static const struct scsi_host_template ep93xx_pata_sht = { 876 876 ATA_BASE_SHT(DRV_NAME), 877 877 /* ep93xx dma implementation limit */ 878 878 .sg_tablesize = 32,
+1 -1
drivers/ata/pata_falcon.c
··· 33 33 #define DRV_NAME "pata_falcon" 34 34 #define DRV_VERSION "0.1.0" 35 35 36 - static struct scsi_host_template pata_falcon_sht = { 36 + static const struct scsi_host_template pata_falcon_sht = { 37 37 ATA_PIO_SHT(DRV_NAME), 38 38 }; 39 39
+1 -1
drivers/ata/pata_ftide010.c
··· 84 84 #define FTIDE010_CLK_MOD_DEV0_UDMA_EN BIT(4) 85 85 #define FTIDE010_CLK_MOD_DEV1_UDMA_EN BIT(5) 86 86 87 - static struct scsi_host_template pata_ftide010_sht = { 87 + static const struct scsi_host_template pata_ftide010_sht = { 88 88 ATA_BMDMA_SHT(DRV_NAME), 89 89 }; 90 90
+1 -1
drivers/ata/pata_gayle.c
··· 35 35 36 36 #define GAYLE_CONTROL 0x101a 37 37 38 - static struct scsi_host_template pata_gayle_sht = { 38 + static const struct scsi_host_template pata_gayle_sht = { 39 39 ATA_PIO_SHT(DRV_NAME), 40 40 }; 41 41
+1 -1
drivers/ata/pata_hpt366.c
··· 312 312 return ata_sff_prereset(link, deadline); 313 313 } 314 314 315 - static struct scsi_host_template hpt36x_sht = { 315 + static const struct scsi_host_template hpt36x_sht = { 316 316 ATA_BMDMA_SHT(DRV_NAME), 317 317 }; 318 318
+1 -1
drivers/ata/pata_hpt37x.c
··· 526 526 } 527 527 528 528 529 - static struct scsi_host_template hpt37x_sht = { 529 + static const struct scsi_host_template hpt37x_sht = { 530 530 ATA_BMDMA_SHT(DRV_NAME), 531 531 }; 532 532
+1 -1
drivers/ata/pata_hpt3x2n.c
··· 337 337 return ata_bmdma_qc_issue(qc); 338 338 } 339 339 340 - static struct scsi_host_template hpt3x2n_sht = { 340 + static const struct scsi_host_template hpt3x2n_sht = { 341 341 ATA_BMDMA_SHT(DRV_NAME), 342 342 }; 343 343
+1 -1
drivers/ata/pata_hpt3x3.c
··· 136 136 137 137 #endif /* CONFIG_PATA_HPT3X3_DMA */ 138 138 139 - static struct scsi_host_template hpt3x3_sht = { 139 + static const struct scsi_host_template hpt3x3_sht = { 140 140 ATA_BMDMA_SHT(DRV_NAME), 141 141 }; 142 142
+1 -1
drivers/ata/pata_icside.c
··· 298 298 } 299 299 300 300 301 - static struct scsi_host_template pata_icside_sht = { 301 + static const struct scsi_host_template pata_icside_sht = { 302 302 ATA_BASE_SHT(DRV_NAME), 303 303 .sg_tablesize = SG_MAX_SEGMENTS, 304 304 .dma_boundary = IOMD_DMA_BOUNDARY,
+1 -1
drivers/ata/pata_imx.c
··· 97 97 __raw_writel(val, priv->host_regs + PATA_IMX_ATA_CONTROL); 98 98 } 99 99 100 - static struct scsi_host_template pata_imx_sht = { 100 + static const struct scsi_host_template pata_imx_sht = { 101 101 ATA_PIO_SHT(DRV_NAME), 102 102 }; 103 103
+1 -1
drivers/ata/pata_isapnp.c
··· 20 20 #define DRV_NAME "pata_isapnp" 21 21 #define DRV_VERSION "0.2.5" 22 22 23 - static struct scsi_host_template isapnp_sht = { 23 + static const struct scsi_host_template isapnp_sht = { 24 24 ATA_PIO_SHT(DRV_NAME), 25 25 }; 26 26
+1 -1
drivers/ata/pata_it8213.c
··· 228 228 pci_write_config_byte(dev, 0x48, udma_enable); 229 229 } 230 230 231 - static struct scsi_host_template it8213_sht = { 231 + static const struct scsi_host_template it8213_sht = { 232 232 ATA_BMDMA_SHT(DRV_NAME), 233 233 }; 234 234
+1 -1
drivers/ata/pata_it821x.c
··· 800 800 return ATA_CBL_PATA80; 801 801 } 802 802 803 - static struct scsi_host_template it821x_sht = { 803 + static const struct scsi_host_template it821x_sht = { 804 804 ATA_BMDMA_SHT(DRV_NAME), 805 805 }; 806 806
+1 -1
drivers/ata/pata_ixp4xx_cf.c
··· 173 173 return words << 1; 174 174 } 175 175 176 - static struct scsi_host_template ixp4xx_sht = { 176 + static const struct scsi_host_template ixp4xx_sht = { 177 177 ATA_PIO_SHT(DRV_NAME), 178 178 }; 179 179
+1 -1
drivers/ata/pata_jmicron.c
··· 107 107 108 108 /* No PIO or DMA methods needed for this device */ 109 109 110 - static struct scsi_host_template jmicron_sht = { 110 + static const struct scsi_host_template jmicron_sht = { 111 111 ATA_BMDMA_SHT(DRV_NAME), 112 112 }; 113 113
+1 -1
drivers/ata/pata_legacy.c
··· 250 250 return 0; 251 251 } 252 252 253 - static struct scsi_host_template legacy_sht = { 253 + static const struct scsi_host_template legacy_sht = { 254 254 ATA_PIO_SHT(DRV_NAME), 255 255 }; 256 256
+1 -1
drivers/ata/pata_macio.c
··· 908 908 } 909 909 #endif /* CONFIG_PM_SLEEP */ 910 910 911 - static struct scsi_host_template pata_macio_sht = { 911 + static const struct scsi_host_template pata_macio_sht = { 912 912 __ATA_BASE_SHT(DRV_NAME), 913 913 .sg_tablesize = MAX_DCMDS, 914 914 /* We may not need that strict one */
+1 -1
drivers/ata/pata_marvell.c
··· 92 92 93 93 /* No PIO or DMA methods needed for this device */ 94 94 95 - static struct scsi_host_template marvell_sht = { 95 + static const struct scsi_host_template marvell_sht = { 96 96 ATA_BMDMA_SHT(DRV_NAME), 97 97 }; 98 98
+1 -1
drivers/ata/pata_mpc52xx.c
··· 606 606 return IRQ_HANDLED; 607 607 } 608 608 609 - static struct scsi_host_template mpc52xx_ata_sht = { 609 + static const struct scsi_host_template mpc52xx_ata_sht = { 610 610 ATA_PIO_SHT(DRV_NAME), 611 611 }; 612 612
+1 -1
drivers/ata/pata_mpiix.c
··· 136 136 return ata_sff_qc_issue(qc); 137 137 } 138 138 139 - static struct scsi_host_template mpiix_sht = { 139 + static const struct scsi_host_template mpiix_sht = { 140 140 ATA_PIO_SHT(DRV_NAME), 141 141 }; 142 142
+1 -1
drivers/ata/pata_netcell.c
··· 31 31 return err_mask; 32 32 } 33 33 34 - static struct scsi_host_template netcell_sht = { 34 + static const struct scsi_host_template netcell_sht = { 35 35 ATA_BMDMA_SHT(DRV_NAME), 36 36 }; 37 37
+1 -1
drivers/ata/pata_ninja32.c
··· 77 77 } 78 78 } 79 79 80 - static struct scsi_host_template ninja32_sht = { 80 + static const struct scsi_host_template ninja32_sht = { 81 81 ATA_BMDMA_SHT(DRV_NAME), 82 82 }; 83 83
+1 -1
drivers/ata/pata_ns87410.c
··· 114 114 return ata_sff_qc_issue(qc); 115 115 } 116 116 117 - static struct scsi_host_template ns87410_sht = { 117 + static const struct scsi_host_template ns87410_sht = { 118 118 ATA_PIO_SHT(DRV_NAME), 119 119 }; 120 120
+1 -1
drivers/ata/pata_ns87415.c
··· 320 320 }; 321 321 #endif 322 322 323 - static struct scsi_host_template ns87415_sht = { 323 + static const struct scsi_host_template ns87415_sht = { 324 324 ATA_BMDMA_SHT(DRV_NAME), 325 325 }; 326 326
+1 -1
drivers/ata/pata_octeon_cf.c
··· 58 58 u64 dma_base; 59 59 }; 60 60 61 - static struct scsi_host_template octeon_cf_sht = { 61 + static const struct scsi_host_template octeon_cf_sht = { 62 62 ATA_PIO_SHT(DRV_NAME), 63 63 }; 64 64
+1 -1
drivers/ata/pata_of_platform.c
··· 15 15 16 16 #define DRV_NAME "pata_of_platform" 17 17 18 - static struct scsi_host_template pata_platform_sht = { 18 + static const struct scsi_host_template pata_platform_sht = { 19 19 ATA_PIO_SHT(DRV_NAME), 20 20 }; 21 21
+1 -1
drivers/ata/pata_oldpiix.c
··· 204 204 } 205 205 206 206 207 - static struct scsi_host_template oldpiix_sht = { 207 + static const struct scsi_host_template oldpiix_sht = { 208 208 ATA_BMDMA_SHT(DRV_NAME), 209 209 }; 210 210
+1 -1
drivers/ata/pata_opti.c
··· 148 148 opti_write_reg(ap, 0x85, CNTRL_REG); 149 149 } 150 150 151 - static struct scsi_host_template opti_sht = { 151 + static const struct scsi_host_template opti_sht = { 152 152 ATA_PIO_SHT(DRV_NAME), 153 153 }; 154 154
+1 -1
drivers/ata/pata_optidma.c
··· 334 334 return rc; 335 335 } 336 336 337 - static struct scsi_host_template optidma_sht = { 337 + static const struct scsi_host_template optidma_sht = { 338 338 ATA_BMDMA_SHT(DRV_NAME), 339 339 }; 340 340
+1 -1
drivers/ata/pata_parport/pata_parport.c
··· 398 398 .release = pata_parport_bus_release, 399 399 }; 400 400 401 - static struct scsi_host_template pata_parport_sht = { 401 + static const struct scsi_host_template pata_parport_sht = { 402 402 PATA_PARPORT_SHT("pata_parport") 403 403 }; 404 404
+1 -1
drivers/ata/pata_pcmcia.c
··· 132 132 133 133 } 134 134 135 - static struct scsi_host_template pcmcia_sht = { 135 + static const struct scsi_host_template pcmcia_sht = { 136 136 ATA_PIO_SHT(DRV_NAME), 137 137 }; 138 138
+1 -1
drivers/ata/pata_pdc2027x.c
··· 122 122 #endif 123 123 }; 124 124 125 - static struct scsi_host_template pdc2027x_sht = { 125 + static const struct scsi_host_template pdc2027x_sht = { 126 126 ATA_BMDMA_SHT(DRV_NAME), 127 127 }; 128 128
+1 -1
drivers/ata/pata_pdc202xx_old.c
··· 289 289 return 1; 290 290 } 291 291 292 - static struct scsi_host_template pdc202xx_sht = { 292 + static const struct scsi_host_template pdc202xx_sht = { 293 293 ATA_BMDMA_SHT(DRV_NAME), 294 294 }; 295 295
+1 -1
drivers/ata/pata_piccolo.c
··· 62 62 } 63 63 64 64 65 - static struct scsi_host_template tosh_sht = { 65 + static const struct scsi_host_template tosh_sht = { 66 66 ATA_BMDMA_SHT(DRV_NAME), 67 67 }; 68 68
+2 -2
drivers/ata/pata_platform.c
··· 45 45 return 0; 46 46 } 47 47 48 - static struct scsi_host_template pata_platform_sht = { 48 + static const struct scsi_host_template pata_platform_sht = { 49 49 ATA_PIO_SHT(DRV_NAME), 50 50 }; 51 51 ··· 97 97 int __pata_platform_probe(struct device *dev, struct resource *io_res, 98 98 struct resource *ctl_res, struct resource *irq_res, 99 99 unsigned int ioport_shift, int __pio_mask, 100 - struct scsi_host_template *sht, bool use16bit) 100 + const struct scsi_host_template *sht, bool use16bit) 101 101 { 102 102 struct ata_host *host; 103 103 struct ata_port *ap;
+1 -1
drivers/ata/pata_pxa.c
··· 136 136 return -EOPNOTSUPP; 137 137 } 138 138 139 - static struct scsi_host_template pxa_ata_sht = { 139 + static const struct scsi_host_template pxa_ata_sht = { 140 140 ATA_BMDMA_SHT(DRV_NAME), 141 141 }; 142 142
+1 -1
drivers/ata/pata_radisys.c
··· 183 183 } 184 184 185 185 186 - static struct scsi_host_template radisys_sht = { 186 + static const struct scsi_host_template radisys_sht = { 187 187 ATA_BMDMA_SHT(DRV_NAME), 188 188 }; 189 189
+1 -1
drivers/ata/pata_rb532_cf.c
··· 73 73 74 74 /* ------------------------------------------------------------------------ */ 75 75 76 - static struct scsi_host_template rb532_pata_sht = { 76 + static const struct scsi_host_template rb532_pata_sht = { 77 77 ATA_PIO_SHT(DRV_NAME), 78 78 }; 79 79
+1 -1
drivers/ata/pata_rdc.c
··· 288 288 .port_ops = &rdc_pata_ops, 289 289 }; 290 290 291 - static struct scsi_host_template rdc_sht = { 291 + static const struct scsi_host_template rdc_sht = { 292 292 ATA_BMDMA_SHT(DRV_NAME), 293 293 }; 294 294
+1 -1
drivers/ata/pata_rz1000.c
··· 50 50 } 51 51 52 52 53 - static struct scsi_host_template rz1000_sht = { 53 + static const struct scsi_host_template rz1000_sht = { 54 54 ATA_PIO_SHT(DRV_NAME), 55 55 }; 56 56
+1 -1
drivers/ata/pata_sc1200.c
··· 192 192 return 0; 193 193 } 194 194 195 - static struct scsi_host_template sc1200_sht = { 195 + static const struct scsi_host_template sc1200_sht = { 196 196 ATA_BASE_SHT(DRV_NAME), 197 197 .sg_tablesize = LIBATA_DUMB_MAX_PRD, 198 198 .dma_boundary = ATA_DMA_BOUNDARY,
+1 -1
drivers/ata/pata_sch.c
··· 57 57 #endif 58 58 }; 59 59 60 - static struct scsi_host_template sch_sht = { 60 + static const struct scsi_host_template sch_sht = { 61 61 ATA_BMDMA_SHT(DRV_NAME), 62 62 }; 63 63
+3 -3
drivers/ata/pata_serverworks.c
··· 252 252 pci_write_config_byte(pdev, 0x54, ultra_cfg); 253 253 } 254 254 255 - static struct scsi_host_template serverworks_osb4_sht = { 255 + static const struct scsi_host_template serverworks_osb4_sht = { 256 256 ATA_BASE_SHT(DRV_NAME), 257 257 .sg_tablesize = LIBATA_DUMB_MAX_PRD, 258 258 .dma_boundary = ATA_DMA_BOUNDARY, 259 259 }; 260 260 261 - static struct scsi_host_template serverworks_csb_sht = { 261 + static const struct scsi_host_template serverworks_csb_sht = { 262 262 ATA_BMDMA_SHT(DRV_NAME), 263 263 }; 264 264 ··· 413 413 } 414 414 }; 415 415 const struct ata_port_info *ppi[] = { &info[id->driver_data], NULL }; 416 - struct scsi_host_template *sht = &serverworks_csb_sht; 416 + const struct scsi_host_template *sht = &serverworks_csb_sht; 417 417 int rc; 418 418 419 419 rc = pcim_enable_device(pdev);
+1 -1
drivers/ata/pata_sil680.c
··· 223 223 return val & 0x08; 224 224 } 225 225 226 - static struct scsi_host_template sil680_sht = { 226 + static const struct scsi_host_template sil680_sht = { 227 227 ATA_BMDMA_SHT(DRV_NAME), 228 228 }; 229 229
+1 -1
drivers/ata/pata_sis.c
··· 539 539 return mask; 540 540 } 541 541 542 - static struct scsi_host_template sis_sht = { 542 + static const struct scsi_host_template sis_sht = { 543 543 ATA_BMDMA_SHT(DRV_NAME), 544 544 }; 545 545
+1 -1
drivers/ata/pata_sl82c105.c
··· 238 238 return val & mask; 239 239 } 240 240 241 - static struct scsi_host_template sl82c105_sht = { 241 + static const struct scsi_host_template sl82c105_sht = { 242 242 ATA_BMDMA_SHT(DRV_NAME), 243 243 }; 244 244
+1 -1
drivers/ata/pata_triflex.c
··· 160 160 triflex_load_timing(qc->ap, qc->dev, qc->dev->pio_mode); 161 161 } 162 162 163 - static struct scsi_host_template triflex_sht = { 163 + static const struct scsi_host_template triflex_sht = { 164 164 ATA_BMDMA_SHT(DRV_NAME), 165 165 }; 166 166
+1 -1
drivers/ata/pata_via.c
··· 443 443 return 0; 444 444 } 445 445 446 - static struct scsi_host_template via_sht = { 446 + static const struct scsi_host_template via_sht = { 447 447 ATA_BMDMA_SHT(DRV_NAME), 448 448 }; 449 449
+1 -1
drivers/ata/pdc_adma.c
··· 123 123 static void adma_thaw(struct ata_port *ap); 124 124 static int adma_prereset(struct ata_link *link, unsigned long deadline); 125 125 126 - static struct scsi_host_template adma_ata_sht = { 126 + static const struct scsi_host_template adma_ata_sht = { 127 127 ATA_BASE_SHT(DRV_NAME), 128 128 .sg_tablesize = LIBATA_MAX_PRD, 129 129 .dma_boundary = ADMA_DMA_BOUNDARY,
+1 -1
drivers/ata/sata_dwc_460ex.c
··· 1076 1076 /* 1077 1077 * scsi mid-layer and libata interface structures 1078 1078 */ 1079 - static struct scsi_host_template sata_dwc_sht = { 1079 + static const struct scsi_host_template sata_dwc_sht = { 1080 1080 ATA_NCQ_SHT(DRV_NAME), 1081 1081 /* 1082 1082 * test-only: Currently this driver doesn't handle NCQ
+1 -1
drivers/ata/sata_fsl.c
··· 1376 1376 /* 1377 1377 * scsi mid-layer and libata interface structures 1378 1378 */ 1379 - static struct scsi_host_template sata_fsl_sht = { 1379 + static const struct scsi_host_template sata_fsl_sht = { 1380 1380 ATA_NCQ_SHT_QD("sata_fsl", SATA_FSL_QUEUE_DEPTH), 1381 1381 .sg_tablesize = SATA_FSL_MAX_PRD_USABLE, 1382 1382 .dma_boundary = ATA_DMA_BOUNDARY,
+1 -1
drivers/ata/sata_highbank.c
··· 438 438 .port_ops = &ahci_highbank_ops, 439 439 }; 440 440 441 - static struct scsi_host_template ahci_highbank_platform_sht = { 441 + static const struct scsi_host_template ahci_highbank_platform_sht = { 442 442 AHCI_SHT("sata_highbank"), 443 443 }; 444 444
+1 -1
drivers/ata/sata_inic162x.c
··· 242 242 dma_addr_t cpb_tbl_dma; 243 243 }; 244 244 245 - static struct scsi_host_template inic_sht = { 245 + static const struct scsi_host_template inic_sht = { 246 246 ATA_BASE_SHT(DRV_NAME), 247 247 .sg_tablesize = LIBATA_MAX_PRD, /* maybe it can be larger? */ 248 248
+2 -2
drivers/ata/sata_mv.c
··· 659 659 * PRDs for 64K boundaries in mv_fill_sg(). 660 660 */ 661 661 #ifdef CONFIG_PCI 662 - static struct scsi_host_template mv5_sht = { 662 + static const struct scsi_host_template mv5_sht = { 663 663 ATA_BASE_SHT(DRV_NAME), 664 664 .sg_tablesize = MV_MAX_SG_CT / 2, 665 665 .dma_boundary = MV_DMA_BOUNDARY, 666 666 }; 667 667 #endif 668 - static struct scsi_host_template mv6_sht = { 668 + static const struct scsi_host_template mv6_sht = { 669 669 __ATA_BASE_SHT(DRV_NAME), 670 670 .can_queue = MV_MAX_Q_DEPTH - 1, 671 671 .sg_tablesize = MV_MAX_SG_CT / 2,
+4 -4
drivers/ata/sata_nv.c
··· 371 371 .remove = ata_pci_remove_one, 372 372 }; 373 373 374 - static struct scsi_host_template nv_sht = { 374 + static const struct scsi_host_template nv_sht = { 375 375 ATA_BMDMA_SHT(DRV_NAME), 376 376 }; 377 377 378 - static struct scsi_host_template nv_adma_sht = { 378 + static const struct scsi_host_template nv_adma_sht = { 379 379 __ATA_BASE_SHT(DRV_NAME), 380 380 .can_queue = NV_ADMA_MAX_CPBS, 381 381 .sg_tablesize = NV_ADMA_SGTBL_TOTAL_LEN, ··· 386 386 .tag_alloc_policy = BLK_TAG_ALLOC_RR, 387 387 }; 388 388 389 - static struct scsi_host_template nv_swncq_sht = { 389 + static const struct scsi_host_template nv_swncq_sht = { 390 390 __ATA_BASE_SHT(DRV_NAME), 391 391 .can_queue = ATA_MAX_QUEUE - 1, 392 392 .sg_tablesize = LIBATA_MAX_PRD, ··· 520 520 521 521 struct nv_pi_priv { 522 522 irq_handler_t irq_handler; 523 - struct scsi_host_template *sht; 523 + const struct scsi_host_template *sht; 524 524 }; 525 525 526 526 #define NV_PI_PRIV(_irq_handler, _sht) \
+1 -1
drivers/ata/sata_promise.c
··· 158 158 static void pdc_post_internal_cmd(struct ata_queued_cmd *qc); 159 159 static int pdc_pata_cable_detect(struct ata_port *ap); 160 160 161 - static struct scsi_host_template pdc_ata_sht = { 161 + static const struct scsi_host_template pdc_ata_sht = { 162 162 ATA_BASE_SHT(DRV_NAME), 163 163 .sg_tablesize = PDC_MAX_PRD, 164 164 .dma_boundary = ATA_DMA_BOUNDARY,
+1 -1
drivers/ata/sata_qstor.c
··· 108 108 static int qs_prereset(struct ata_link *link, unsigned long deadline); 109 109 static void qs_error_handler(struct ata_port *ap); 110 110 111 - static struct scsi_host_template qs_ata_sht = { 111 + static const struct scsi_host_template qs_ata_sht = { 112 112 ATA_BASE_SHT(DRV_NAME), 113 113 .sg_tablesize = QS_MAX_PRD, 114 114 .dma_boundary = QS_DMA_BOUNDARY,
+1 -1
drivers/ata/sata_rcar.c
··· 608 608 return host_stat; 609 609 } 610 610 611 - static struct scsi_host_template sata_rcar_sht = { 611 + static const struct scsi_host_template sata_rcar_sht = { 612 612 ATA_BASE_SHT(DRV_NAME), 613 613 /* 614 614 * This controller allows transfer chunks up to 512MB which cross 64KB
+1 -1
drivers/ata/sata_sil.c
··· 156 156 #endif 157 157 }; 158 158 159 - static struct scsi_host_template sil_sht = { 159 + static const struct scsi_host_template sil_sht = { 160 160 ATA_BASE_SHT(DRV_NAME), 161 161 /** These controllers support Large Block Transfer which allows 162 162 transfer chunks up to 2GB and which cross 64KB boundaries,
+1 -1
drivers/ata/sata_sil24.c
··· 373 373 #endif 374 374 }; 375 375 376 - static struct scsi_host_template sil24_sht = { 376 + static const struct scsi_host_template sil24_sht = { 377 377 __ATA_BASE_SHT(DRV_NAME), 378 378 .can_queue = SIL24_MAX_CMDS, 379 379 .sg_tablesize = SIL24_MAX_SGE,
+1 -1
drivers/ata/sata_sis.c
··· 72 72 #endif 73 73 }; 74 74 75 - static struct scsi_host_template sis_sht = { 75 + static const struct scsi_host_template sis_sht = { 76 76 ATA_BMDMA_SHT(DRV_NAME), 77 77 }; 78 78
+1 -1
drivers/ata/sata_svw.c
··· 330 330 return 0; 331 331 } 332 332 333 - static struct scsi_host_template k2_sata_sht = { 333 + static const struct scsi_host_template k2_sata_sht = { 334 334 ATA_BMDMA_SHT(DRV_NAME), 335 335 .show_info = k2_sata_show_info, 336 336 };
+1 -1
drivers/ata/sata_sx4.c
··· 226 226 static int pdc_check_atapi_dma(struct ata_queued_cmd *qc); 227 227 228 228 229 - static struct scsi_host_template pdc_sata_sht = { 229 + static const struct scsi_host_template pdc_sata_sht = { 230 230 ATA_BASE_SHT(DRV_NAME), 231 231 .sg_tablesize = LIBATA_MAX_PRD, 232 232 .dma_boundary = ATA_DMA_BOUNDARY,
+1 -1
drivers/ata/sata_uli.c
··· 59 59 .remove = ata_pci_remove_one, 60 60 }; 61 61 62 - static struct scsi_host_template uli_sht = { 62 + static const struct scsi_host_template uli_sht = { 63 63 ATA_BMDMA_SHT(DRV_NAME), 64 64 }; 65 65
+1 -1
drivers/ata/sata_via.c
··· 107 107 .remove = ata_pci_remove_one, 108 108 }; 109 109 110 - static struct scsi_host_template svia_sht = { 110 + static const struct scsi_host_template svia_sht = { 111 111 ATA_BMDMA_SHT(DRV_NAME), 112 112 }; 113 113
+1 -1
drivers/ata/sata_vsc.c
··· 277 277 } 278 278 279 279 280 - static struct scsi_host_template vsc_sata_sht = { 280 + static const struct scsi_host_template vsc_sata_sht = { 281 281 ATA_BMDMA_SHT(DRV_NAME), 282 282 }; 283 283
+1 -1
include/linux/ahci_platform.h
··· 37 37 int ahci_platform_init_host(struct platform_device *pdev, 38 38 struct ahci_host_priv *hpriv, 39 39 const struct ata_port_info *pi_template, 40 - struct scsi_host_template *sht); 40 + const struct scsi_host_template *sht); 41 41 42 42 void ahci_platform_shutdown(struct platform_device *pdev); 43 43
+1 -1
include/linux/ata_platform.h
··· 19 19 struct resource *irq_res, 20 20 unsigned int ioport_shift, 21 21 int __pio_mask, 22 - struct scsi_host_template *sht, 22 + const struct scsi_host_template *sht, 23 23 bool use16bit); 24 24 25 25 /*
+5 -5
include/linux/libata.h
··· 1065 1065 extern void ata_host_put(struct ata_host *host); 1066 1066 extern int ata_host_start(struct ata_host *host); 1067 1067 extern int ata_host_register(struct ata_host *host, 1068 - struct scsi_host_template *sht); 1068 + const struct scsi_host_template *sht); 1069 1069 extern int ata_host_activate(struct ata_host *host, int irq, 1070 1070 irq_handler_t irq_handler, unsigned long irq_flags, 1071 - struct scsi_host_template *sht); 1071 + const struct scsi_host_template *sht); 1072 1072 extern void ata_host_detach(struct ata_host *host); 1073 1073 extern void ata_host_init(struct ata_host *, struct device *, struct ata_port_operations *); 1074 1074 extern int ata_scsi_detect(struct scsi_host_template *sht); ··· 1980 1980 struct ata_host **r_host); 1981 1981 extern int ata_pci_sff_activate_host(struct ata_host *host, 1982 1982 irq_handler_t irq_handler, 1983 - struct scsi_host_template *sht); 1983 + const struct scsi_host_template *sht); 1984 1984 extern int ata_pci_sff_init_one(struct pci_dev *pdev, 1985 1985 const struct ata_port_info * const * ppi, 1986 - struct scsi_host_template *sht, void *host_priv, int hflags); 1986 + const struct scsi_host_template *sht, void *host_priv, int hflags); 1987 1987 #endif /* CONFIG_PCI */ 1988 1988 1989 1989 #ifdef CONFIG_ATA_BMDMA ··· 2019 2019 struct ata_host **r_host); 2020 2020 extern int ata_pci_bmdma_init_one(struct pci_dev *pdev, 2021 2021 const struct ata_port_info * const * ppi, 2022 - struct scsi_host_template *sht, 2022 + const struct scsi_host_template *sht, 2023 2023 void *host_priv, int hflags); 2024 2024 #endif /* CONFIG_PCI */ 2025 2025 #endif /* CONFIG_ATA_BMDMA */