Loading drivers/scsi/ahci.c +1 −1 Original line number Original line Diff line number Diff line Loading @@ -216,7 +216,7 @@ static Scsi_Host_Template ahci_sht = { .ordered_flush = 1, .ordered_flush = 1, }; }; static struct ata_port_operations ahci_ops = { static const struct ata_port_operations ahci_ops = { .port_disable = ata_port_disable, .port_disable = ata_port_disable, .check_status = ahci_check_status, .check_status = ahci_check_status, Loading drivers/scsi/ata_piix.c +2 −2 Original line number Original line Diff line number Diff line Loading @@ -147,7 +147,7 @@ static Scsi_Host_Template piix_sht = { .ordered_flush = 1, .ordered_flush = 1, }; }; static struct ata_port_operations piix_pata_ops = { static const struct ata_port_operations piix_pata_ops = { .port_disable = ata_port_disable, .port_disable = ata_port_disable, .set_piomode = piix_set_piomode, .set_piomode = piix_set_piomode, .set_dmamode = piix_set_dmamode, .set_dmamode = piix_set_dmamode, Loading Loading @@ -177,7 +177,7 @@ static struct ata_port_operations piix_pata_ops = { .host_stop = ata_host_stop, .host_stop = ata_host_stop, }; }; static struct ata_port_operations piix_sata_ops = { static const struct ata_port_operations piix_sata_ops = { .port_disable = ata_port_disable, .port_disable = ata_port_disable, .tf_load = ata_tf_load, .tf_load = ata_tf_load, Loading drivers/scsi/libata-core.c +34 −34 Original line number Original line Diff line number Diff line Loading @@ -67,9 +67,9 @@ static void ata_dev_reread_id(struct ata_port *ap, struct ata_device *dev); static void ata_dev_init_params(struct ata_port *ap, struct ata_device *dev); static void ata_dev_init_params(struct ata_port *ap, struct ata_device *dev); static void ata_set_mode(struct ata_port *ap); static void ata_set_mode(struct ata_port *ap); static void ata_dev_set_xfermode(struct ata_port *ap, struct ata_device *dev); static void ata_dev_set_xfermode(struct ata_port *ap, struct ata_device *dev); static unsigned int ata_get_mode_mask(struct ata_port *ap, int shift); static unsigned int ata_get_mode_mask(const struct ata_port *ap, int shift); static int fgb(u32 bitmap); static int fgb(u32 bitmap); static int ata_choose_xfer_mode(struct ata_port *ap, static int ata_choose_xfer_mode(const struct ata_port *ap, u8 *xfer_mode_out, u8 *xfer_mode_out, unsigned int *xfer_shift_out); unsigned int *xfer_shift_out); static void __ata_qc_complete(struct ata_queued_cmd *qc); static void __ata_qc_complete(struct ata_queued_cmd *qc); Loading Loading @@ -97,7 +97,7 @@ MODULE_VERSION(DRV_VERSION); * Inherited from caller. * Inherited from caller. */ */ static void ata_tf_load_pio(struct ata_port *ap, struct ata_taskfile *tf) static void ata_tf_load_pio(struct ata_port *ap, const struct ata_taskfile *tf) { { struct ata_ioports *ioaddr = &ap->ioaddr; struct ata_ioports *ioaddr = &ap->ioaddr; unsigned int is_addr = tf->flags & ATA_TFLAG_ISADDR; unsigned int is_addr = tf->flags & ATA_TFLAG_ISADDR; Loading Loading @@ -155,7 +155,7 @@ static void ata_tf_load_pio(struct ata_port *ap, struct ata_taskfile *tf) * Inherited from caller. * Inherited from caller. */ */ static void ata_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf) static void ata_tf_load_mmio(struct ata_port *ap, const struct ata_taskfile *tf) { { struct ata_ioports *ioaddr = &ap->ioaddr; struct ata_ioports *ioaddr = &ap->ioaddr; unsigned int is_addr = tf->flags & ATA_TFLAG_ISADDR; unsigned int is_addr = tf->flags & ATA_TFLAG_ISADDR; Loading Loading @@ -224,7 +224,7 @@ static void ata_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf) * LOCKING: * LOCKING: * Inherited from caller. * Inherited from caller. */ */ void ata_tf_load(struct ata_port *ap, struct ata_taskfile *tf) void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf) { { if (ap->flags & ATA_FLAG_MMIO) if (ap->flags & ATA_FLAG_MMIO) ata_tf_load_mmio(ap, tf); ata_tf_load_mmio(ap, tf); Loading @@ -244,7 +244,7 @@ void ata_tf_load(struct ata_port *ap, struct ata_taskfile *tf) * spin_lock_irqsave(host_set lock) * spin_lock_irqsave(host_set lock) */ */ static void ata_exec_command_pio(struct ata_port *ap, struct ata_taskfile *tf) static void ata_exec_command_pio(struct ata_port *ap, const struct ata_taskfile *tf) { { DPRINTK("ata%u: cmd 0x%X\n", ap->id, tf->command); DPRINTK("ata%u: cmd 0x%X\n", ap->id, tf->command); Loading @@ -265,7 +265,7 @@ static void ata_exec_command_pio(struct ata_port *ap, struct ata_taskfile *tf) * spin_lock_irqsave(host_set lock) * spin_lock_irqsave(host_set lock) */ */ static void ata_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf) static void ata_exec_command_mmio(struct ata_port *ap, const struct ata_taskfile *tf) { { DPRINTK("ata%u: cmd 0x%X\n", ap->id, tf->command); DPRINTK("ata%u: cmd 0x%X\n", ap->id, tf->command); Loading @@ -285,7 +285,7 @@ static void ata_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf) * LOCKING: * LOCKING: * spin_lock_irqsave(host_set lock) * spin_lock_irqsave(host_set lock) */ */ void ata_exec_command(struct ata_port *ap, struct ata_taskfile *tf) void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf) { { if (ap->flags & ATA_FLAG_MMIO) if (ap->flags & ATA_FLAG_MMIO) ata_exec_command_mmio(ap, tf); ata_exec_command_mmio(ap, tf); Loading @@ -305,7 +305,7 @@ void ata_exec_command(struct ata_port *ap, struct ata_taskfile *tf) * Obtains host_set lock. * Obtains host_set lock. */ */ static inline void ata_exec(struct ata_port *ap, struct ata_taskfile *tf) static inline void ata_exec(struct ata_port *ap, const struct ata_taskfile *tf) { { unsigned long flags; unsigned long flags; Loading @@ -328,7 +328,7 @@ static inline void ata_exec(struct ata_port *ap, struct ata_taskfile *tf) * Obtains host_set lock. * Obtains host_set lock. */ */ static void ata_tf_to_host(struct ata_port *ap, struct ata_taskfile *tf) static void ata_tf_to_host(struct ata_port *ap, const struct ata_taskfile *tf) { { ap->ops->tf_load(ap, tf); ap->ops->tf_load(ap, tf); Loading @@ -348,7 +348,7 @@ static void ata_tf_to_host(struct ata_port *ap, struct ata_taskfile *tf) * spin_lock_irqsave(host_set lock) * spin_lock_irqsave(host_set lock) */ */ void ata_tf_to_host_nolock(struct ata_port *ap, struct ata_taskfile *tf) void ata_tf_to_host_nolock(struct ata_port *ap, const struct ata_taskfile *tf) { { ap->ops->tf_load(ap, tf); ap->ops->tf_load(ap, tf); ap->ops->exec_command(ap, tf); ap->ops->exec_command(ap, tf); Loading Loading @@ -558,7 +558,7 @@ u8 ata_chk_err(struct ata_port *ap) * Inherited from caller. * Inherited from caller. */ */ void ata_tf_to_fis(struct ata_taskfile *tf, u8 *fis, u8 pmp) void ata_tf_to_fis(const struct ata_taskfile *tf, u8 *fis, u8 pmp) { { fis[0] = 0x27; /* Register - Host to Device FIS */ fis[0] = 0x27; /* Register - Host to Device FIS */ fis[1] = (pmp & 0xf) | (1 << 7); /* Port multiplier number, fis[1] = (pmp & 0xf) | (1 << 7); /* Port multiplier number, Loading Loading @@ -599,7 +599,7 @@ void ata_tf_to_fis(struct ata_taskfile *tf, u8 *fis, u8 pmp) * Inherited from caller. * Inherited from caller. */ */ void ata_tf_from_fis(u8 *fis, struct ata_taskfile *tf) void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf) { { tf->command = fis[2]; /* status */ tf->command = fis[2]; /* status */ tf->feature = fis[3]; /* error */ tf->feature = fis[3]; /* error */ Loading Loading @@ -845,7 +845,7 @@ static unsigned int ata_devchk(struct ata_port *ap, * the event of failure. * the event of failure. */ */ unsigned int ata_dev_classify(struct ata_taskfile *tf) unsigned int ata_dev_classify(const struct ata_taskfile *tf) { { /* Apple's open source Darwin code hints that some devices only /* Apple's open source Darwin code hints that some devices only * put a proper signature into the LBA mid/high registers, * put a proper signature into the LBA mid/high registers, Loading Loading @@ -937,7 +937,7 @@ static u8 ata_dev_try_classify(struct ata_port *ap, unsigned int device) * caller. * caller. */ */ void ata_dev_id_string(u16 *id, unsigned char *s, void ata_dev_id_string(const u16 *id, unsigned char *s, unsigned int ofs, unsigned int len) unsigned int ofs, unsigned int len) { { unsigned int c; unsigned int c; Loading Loading @@ -1054,7 +1054,7 @@ void ata_dev_select(struct ata_port *ap, unsigned int device, * caller. * caller. */ */ static inline void ata_dump_id(struct ata_device *dev) static inline void ata_dump_id(const struct ata_device *dev) { { DPRINTK("49==0x%04x " DPRINTK("49==0x%04x " "53==0x%04x " "53==0x%04x " Loading Loading @@ -1089,7 +1089,7 @@ static inline void ata_dump_id(struct ata_device *dev) * FIXME: pre IDE drive timing (do we care ?). * FIXME: pre IDE drive timing (do we care ?). */ */ static unsigned int ata_pio_modes(struct ata_device *adev) static unsigned int ata_pio_modes(const struct ata_device *adev) { { u16 modes; u16 modes; Loading Loading @@ -1352,7 +1352,7 @@ static void ata_dev_identify(struct ata_port *ap, unsigned int device) } } static inline u8 ata_dev_knobble(struct ata_port *ap) static inline u8 ata_dev_knobble(const struct ata_port *ap) { { return ((ap->cbl == ATA_CBL_SATA) && (!ata_id_is_sata(ap->device->id))); return ((ap->cbl == ATA_CBL_SATA) && (!ata_id_is_sata(ap->device->id))); } } Loading Loading @@ -1684,7 +1684,7 @@ int ata_timing_compute(struct ata_device *adev, unsigned short speed, return 0; return 0; } } static struct { static const struct { unsigned int shift; unsigned int shift; u8 base; u8 base; } xfer_mode_classes[] = { } xfer_mode_classes[] = { Loading Loading @@ -2093,7 +2093,8 @@ void ata_bus_reset(struct ata_port *ap) DPRINTK("EXIT\n"); DPRINTK("EXIT\n"); } } static void ata_pr_blacklisted(struct ata_port *ap, struct ata_device *dev) static void ata_pr_blacklisted(const struct ata_port *ap, const struct ata_device *dev) { { printk(KERN_WARNING "ata%u: dev %u is on DMA blacklist, disabling DMA\n", printk(KERN_WARNING "ata%u: dev %u is on DMA blacklist, disabling DMA\n", ap->id, dev->devno); ap->id, dev->devno); Loading Loading @@ -2131,7 +2132,7 @@ static const char * ata_dma_blacklist [] = { "_NEC DV5800A", "_NEC DV5800A", }; }; static int ata_dma_blacklisted(struct ata_port *ap, struct ata_device *dev) static int ata_dma_blacklisted(const struct ata_device *dev) { { unsigned char model_num[40]; unsigned char model_num[40]; char *s; char *s; Loading @@ -2156,9 +2157,9 @@ static int ata_dma_blacklisted(struct ata_port *ap, struct ata_device *dev) return 0; return 0; } } static unsigned int ata_get_mode_mask(struct ata_port *ap, int shift) static unsigned int ata_get_mode_mask(const struct ata_port *ap, int shift) { { struct ata_device *master, *slave; const struct ata_device *master, *slave; unsigned int mask; unsigned int mask; master = &ap->device[0]; master = &ap->device[0]; Loading @@ -2170,14 +2171,14 @@ static unsigned int ata_get_mode_mask(struct ata_port *ap, int shift) mask = ap->udma_mask; mask = ap->udma_mask; if (ata_dev_present(master)) { if (ata_dev_present(master)) { mask &= (master->id[ATA_ID_UDMA_MODES] & 0xff); mask &= (master->id[ATA_ID_UDMA_MODES] & 0xff); if (ata_dma_blacklisted(ap, master)) { if (ata_dma_blacklisted(master)) { mask = 0; mask = 0; ata_pr_blacklisted(ap, master); ata_pr_blacklisted(ap, master); } } } } if (ata_dev_present(slave)) { if (ata_dev_present(slave)) { mask &= (slave->id[ATA_ID_UDMA_MODES] & 0xff); mask &= (slave->id[ATA_ID_UDMA_MODES] & 0xff); if (ata_dma_blacklisted(ap, slave)) { if (ata_dma_blacklisted(slave)) { mask = 0; mask = 0; ata_pr_blacklisted(ap, slave); ata_pr_blacklisted(ap, slave); } } Loading @@ -2187,14 +2188,14 @@ static unsigned int ata_get_mode_mask(struct ata_port *ap, int shift) mask = ap->mwdma_mask; mask = ap->mwdma_mask; if (ata_dev_present(master)) { if (ata_dev_present(master)) { mask &= (master->id[ATA_ID_MWDMA_MODES] & 0x07); mask &= (master->id[ATA_ID_MWDMA_MODES] & 0x07); if (ata_dma_blacklisted(ap, master)) { if (ata_dma_blacklisted(master)) { mask = 0; mask = 0; ata_pr_blacklisted(ap, master); ata_pr_blacklisted(ap, master); } } } } if (ata_dev_present(slave)) { if (ata_dev_present(slave)) { mask &= (slave->id[ATA_ID_MWDMA_MODES] & 0x07); mask &= (slave->id[ATA_ID_MWDMA_MODES] & 0x07); if (ata_dma_blacklisted(ap, slave)) { if (ata_dma_blacklisted(slave)) { mask = 0; mask = 0; ata_pr_blacklisted(ap, slave); ata_pr_blacklisted(ap, slave); } } Loading Loading @@ -2258,7 +2259,7 @@ static int fgb(u32 bitmap) * Zero on success, negative on error. * Zero on success, negative on error. */ */ static int ata_choose_xfer_mode(struct ata_port *ap, static int ata_choose_xfer_mode(const struct ata_port *ap, u8 *xfer_mode_out, u8 *xfer_mode_out, unsigned int *xfer_shift_out) unsigned int *xfer_shift_out) { { Loading Loading @@ -4144,7 +4145,7 @@ static void ata_host_remove(struct ata_port *ap, unsigned int do_unregister) static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host, static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host, struct ata_host_set *host_set, struct ata_host_set *host_set, struct ata_probe_ent *ent, unsigned int port_no) const struct ata_probe_ent *ent, unsigned int port_no) { { unsigned int i; unsigned int i; Loading Loading @@ -4203,7 +4204,7 @@ static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host, * * */ */ static struct ata_port * ata_host_add(struct ata_probe_ent *ent, static struct ata_port * ata_host_add(const struct ata_probe_ent *ent, struct ata_host_set *host_set, struct ata_host_set *host_set, unsigned int port_no) unsigned int port_no) { { Loading Loading @@ -4251,7 +4252,7 @@ static struct ata_port * ata_host_add(struct ata_probe_ent *ent, * * */ */ int ata_device_add(struct ata_probe_ent *ent) int ata_device_add(const struct ata_probe_ent *ent) { { unsigned int count = 0, i; unsigned int count = 0, i; struct device *dev = ent->dev; struct device *dev = ent->dev; Loading Loading @@ -4470,7 +4471,7 @@ void ata_std_ports(struct ata_ioports *ioaddr) } } static struct ata_probe_ent * static struct ata_probe_ent * ata_probe_ent_alloc(struct device *dev, struct ata_port_info *port) ata_probe_ent_alloc(struct device *dev, const struct ata_port_info *port) { { struct ata_probe_ent *probe_ent; struct ata_probe_ent *probe_ent; Loading Loading @@ -4570,7 +4571,6 @@ static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev, stru if (!probe_ent) if (!probe_ent) return NULL; return NULL; probe_ent->legacy_mode = 1; probe_ent->legacy_mode = 1; probe_ent->n_ports = 1; probe_ent->n_ports = 1; probe_ent->hard_port_no = port_num; probe_ent->hard_port_no = port_num; Loading Loading @@ -4783,7 +4783,7 @@ void ata_pci_remove_one (struct pci_dev *pdev) } } /* move to PCI subsystem */ /* move to PCI subsystem */ int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits) int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits) { { unsigned long tmp = 0; unsigned long tmp = 0; Loading drivers/scsi/libata-scsi.c +12 −12 Original line number Original line Diff line number Diff line Loading @@ -44,9 +44,9 @@ #include "libata.h" #include "libata.h" typedef unsigned int (*ata_xlat_func_t)(struct ata_queued_cmd *qc, u8 *scsicmd); typedef unsigned int (*ata_xlat_func_t)(struct ata_queued_cmd *qc, const u8 *scsicmd); static struct ata_device * static struct ata_device * ata_scsi_find_dev(struct ata_port *ap, struct scsi_device *scsidev); ata_scsi_find_dev(struct ata_port *ap, const struct scsi_device *scsidev); static void ata_scsi_invalid_field(struct scsi_cmnd *cmd, static void ata_scsi_invalid_field(struct scsi_cmnd *cmd, Loading Loading @@ -418,7 +418,7 @@ int ata_scsi_error(struct Scsi_Host *host) */ */ static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc, static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc, u8 *scsicmd) const u8 *scsicmd) { { struct ata_taskfile *tf = &qc->tf; struct ata_taskfile *tf = &qc->tf; Loading Loading @@ -485,7 +485,7 @@ static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc, * Zero on success, non-zero on error. * Zero on success, non-zero on error. */ */ static unsigned int ata_scsi_flush_xlat(struct ata_queued_cmd *qc, u8 *scsicmd) static unsigned int ata_scsi_flush_xlat(struct ata_queued_cmd *qc, const u8 *scsicmd) { { struct ata_taskfile *tf = &qc->tf; struct ata_taskfile *tf = &qc->tf; Loading @@ -512,7 +512,7 @@ static unsigned int ata_scsi_flush_xlat(struct ata_queued_cmd *qc, u8 *scsicmd) * @plen: the transfer length * @plen: the transfer length */ */ static void scsi_6_lba_len(u8 *scsicmd, u64 *plba, u32 *plen) static void scsi_6_lba_len(const u8 *scsicmd, u64 *plba, u32 *plen) { { u64 lba = 0; u64 lba = 0; u32 len = 0; u32 len = 0; Loading @@ -539,7 +539,7 @@ static void scsi_6_lba_len(u8 *scsicmd, u64 *plba, u32 *plen) * @plen: the transfer length * @plen: the transfer length */ */ static void scsi_10_lba_len(u8 *scsicmd, u64 *plba, u32 *plen) static void scsi_10_lba_len(const u8 *scsicmd, u64 *plba, u32 *plen) { { u64 lba = 0; u64 lba = 0; u32 len = 0; u32 len = 0; Loading Loading @@ -569,7 +569,7 @@ static void scsi_10_lba_len(u8 *scsicmd, u64 *plba, u32 *plen) * @plen: the transfer length * @plen: the transfer length */ */ static void scsi_16_lba_len(u8 *scsicmd, u64 *plba, u32 *plen) static void scsi_16_lba_len(const u8 *scsicmd, u64 *plba, u32 *plen) { { u64 lba = 0; u64 lba = 0; u32 len = 0; u32 len = 0; Loading Loading @@ -608,7 +608,7 @@ static void scsi_16_lba_len(u8 *scsicmd, u64 *plba, u32 *plen) * Zero on success, non-zero on error. * Zero on success, non-zero on error. */ */ static unsigned int ata_scsi_verify_xlat(struct ata_queued_cmd *qc, u8 *scsicmd) static unsigned int ata_scsi_verify_xlat(struct ata_queued_cmd *qc, const u8 *scsicmd) { { struct ata_taskfile *tf = &qc->tf; struct ata_taskfile *tf = &qc->tf; struct ata_device *dev = qc->dev; struct ata_device *dev = qc->dev; Loading Loading @@ -734,7 +734,7 @@ static unsigned int ata_scsi_verify_xlat(struct ata_queued_cmd *qc, u8 *scsicmd) * Zero on success, non-zero on error. * Zero on success, non-zero on error. */ */ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, u8 *scsicmd) static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, const u8 *scsicmd) { { struct ata_taskfile *tf = &qc->tf; struct ata_taskfile *tf = &qc->tf; struct ata_device *dev = qc->dev; struct ata_device *dev = qc->dev; Loading Loading @@ -1688,7 +1688,7 @@ static int atapi_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat) * Zero on success, non-zero on failure. * Zero on success, non-zero on failure. */ */ static unsigned int atapi_xlat(struct ata_queued_cmd *qc, u8 *scsicmd) static unsigned int atapi_xlat(struct ata_queued_cmd *qc, const u8 *scsicmd) { { struct scsi_cmnd *cmd = qc->scsicmd; struct scsi_cmnd *cmd = qc->scsicmd; struct ata_device *dev = qc->dev; struct ata_device *dev = qc->dev; Loading Loading @@ -1757,7 +1757,7 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc, u8 *scsicmd) */ */ static struct ata_device * static struct ata_device * ata_scsi_find_dev(struct ata_port *ap, struct scsi_device *scsidev) ata_scsi_find_dev(struct ata_port *ap, const struct scsi_device *scsidev) { { struct ata_device *dev; struct ata_device *dev; Loading Loading @@ -1914,7 +1914,7 @@ void ata_scsi_simulate(u16 *id, void (*done)(struct scsi_cmnd *)) void (*done)(struct scsi_cmnd *)) { { struct ata_scsi_args args; struct ata_scsi_args args; u8 *scsicmd = cmd->cmnd; const u8 *scsicmd = cmd->cmnd; args.id = id; args.id = id; args.cmd = cmd; args.cmd = cmd; Loading drivers/scsi/libata.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -48,7 +48,7 @@ extern int ata_qc_issue(struct ata_queued_cmd *qc); extern int ata_check_atapi_dma(struct ata_queued_cmd *qc); extern int ata_check_atapi_dma(struct ata_queued_cmd *qc); extern void ata_dev_select(struct ata_port *ap, unsigned int device, extern void ata_dev_select(struct ata_port *ap, unsigned int device, unsigned int wait, unsigned int can_sleep); unsigned int wait, unsigned int can_sleep); extern void ata_tf_to_host_nolock(struct ata_port *ap, struct ata_taskfile *tf); extern void ata_tf_to_host_nolock(struct ata_port *ap, const struct ata_taskfile *tf); extern void swap_buf_le16(u16 *buf, unsigned int buf_words); extern void swap_buf_le16(u16 *buf, unsigned int buf_words); Loading Loading
drivers/scsi/ahci.c +1 −1 Original line number Original line Diff line number Diff line Loading @@ -216,7 +216,7 @@ static Scsi_Host_Template ahci_sht = { .ordered_flush = 1, .ordered_flush = 1, }; }; static struct ata_port_operations ahci_ops = { static const struct ata_port_operations ahci_ops = { .port_disable = ata_port_disable, .port_disable = ata_port_disable, .check_status = ahci_check_status, .check_status = ahci_check_status, Loading
drivers/scsi/ata_piix.c +2 −2 Original line number Original line Diff line number Diff line Loading @@ -147,7 +147,7 @@ static Scsi_Host_Template piix_sht = { .ordered_flush = 1, .ordered_flush = 1, }; }; static struct ata_port_operations piix_pata_ops = { static const struct ata_port_operations piix_pata_ops = { .port_disable = ata_port_disable, .port_disable = ata_port_disable, .set_piomode = piix_set_piomode, .set_piomode = piix_set_piomode, .set_dmamode = piix_set_dmamode, .set_dmamode = piix_set_dmamode, Loading Loading @@ -177,7 +177,7 @@ static struct ata_port_operations piix_pata_ops = { .host_stop = ata_host_stop, .host_stop = ata_host_stop, }; }; static struct ata_port_operations piix_sata_ops = { static const struct ata_port_operations piix_sata_ops = { .port_disable = ata_port_disable, .port_disable = ata_port_disable, .tf_load = ata_tf_load, .tf_load = ata_tf_load, Loading
drivers/scsi/libata-core.c +34 −34 Original line number Original line Diff line number Diff line Loading @@ -67,9 +67,9 @@ static void ata_dev_reread_id(struct ata_port *ap, struct ata_device *dev); static void ata_dev_init_params(struct ata_port *ap, struct ata_device *dev); static void ata_dev_init_params(struct ata_port *ap, struct ata_device *dev); static void ata_set_mode(struct ata_port *ap); static void ata_set_mode(struct ata_port *ap); static void ata_dev_set_xfermode(struct ata_port *ap, struct ata_device *dev); static void ata_dev_set_xfermode(struct ata_port *ap, struct ata_device *dev); static unsigned int ata_get_mode_mask(struct ata_port *ap, int shift); static unsigned int ata_get_mode_mask(const struct ata_port *ap, int shift); static int fgb(u32 bitmap); static int fgb(u32 bitmap); static int ata_choose_xfer_mode(struct ata_port *ap, static int ata_choose_xfer_mode(const struct ata_port *ap, u8 *xfer_mode_out, u8 *xfer_mode_out, unsigned int *xfer_shift_out); unsigned int *xfer_shift_out); static void __ata_qc_complete(struct ata_queued_cmd *qc); static void __ata_qc_complete(struct ata_queued_cmd *qc); Loading Loading @@ -97,7 +97,7 @@ MODULE_VERSION(DRV_VERSION); * Inherited from caller. * Inherited from caller. */ */ static void ata_tf_load_pio(struct ata_port *ap, struct ata_taskfile *tf) static void ata_tf_load_pio(struct ata_port *ap, const struct ata_taskfile *tf) { { struct ata_ioports *ioaddr = &ap->ioaddr; struct ata_ioports *ioaddr = &ap->ioaddr; unsigned int is_addr = tf->flags & ATA_TFLAG_ISADDR; unsigned int is_addr = tf->flags & ATA_TFLAG_ISADDR; Loading Loading @@ -155,7 +155,7 @@ static void ata_tf_load_pio(struct ata_port *ap, struct ata_taskfile *tf) * Inherited from caller. * Inherited from caller. */ */ static void ata_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf) static void ata_tf_load_mmio(struct ata_port *ap, const struct ata_taskfile *tf) { { struct ata_ioports *ioaddr = &ap->ioaddr; struct ata_ioports *ioaddr = &ap->ioaddr; unsigned int is_addr = tf->flags & ATA_TFLAG_ISADDR; unsigned int is_addr = tf->flags & ATA_TFLAG_ISADDR; Loading Loading @@ -224,7 +224,7 @@ static void ata_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf) * LOCKING: * LOCKING: * Inherited from caller. * Inherited from caller. */ */ void ata_tf_load(struct ata_port *ap, struct ata_taskfile *tf) void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf) { { if (ap->flags & ATA_FLAG_MMIO) if (ap->flags & ATA_FLAG_MMIO) ata_tf_load_mmio(ap, tf); ata_tf_load_mmio(ap, tf); Loading @@ -244,7 +244,7 @@ void ata_tf_load(struct ata_port *ap, struct ata_taskfile *tf) * spin_lock_irqsave(host_set lock) * spin_lock_irqsave(host_set lock) */ */ static void ata_exec_command_pio(struct ata_port *ap, struct ata_taskfile *tf) static void ata_exec_command_pio(struct ata_port *ap, const struct ata_taskfile *tf) { { DPRINTK("ata%u: cmd 0x%X\n", ap->id, tf->command); DPRINTK("ata%u: cmd 0x%X\n", ap->id, tf->command); Loading @@ -265,7 +265,7 @@ static void ata_exec_command_pio(struct ata_port *ap, struct ata_taskfile *tf) * spin_lock_irqsave(host_set lock) * spin_lock_irqsave(host_set lock) */ */ static void ata_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf) static void ata_exec_command_mmio(struct ata_port *ap, const struct ata_taskfile *tf) { { DPRINTK("ata%u: cmd 0x%X\n", ap->id, tf->command); DPRINTK("ata%u: cmd 0x%X\n", ap->id, tf->command); Loading @@ -285,7 +285,7 @@ static void ata_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf) * LOCKING: * LOCKING: * spin_lock_irqsave(host_set lock) * spin_lock_irqsave(host_set lock) */ */ void ata_exec_command(struct ata_port *ap, struct ata_taskfile *tf) void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf) { { if (ap->flags & ATA_FLAG_MMIO) if (ap->flags & ATA_FLAG_MMIO) ata_exec_command_mmio(ap, tf); ata_exec_command_mmio(ap, tf); Loading @@ -305,7 +305,7 @@ void ata_exec_command(struct ata_port *ap, struct ata_taskfile *tf) * Obtains host_set lock. * Obtains host_set lock. */ */ static inline void ata_exec(struct ata_port *ap, struct ata_taskfile *tf) static inline void ata_exec(struct ata_port *ap, const struct ata_taskfile *tf) { { unsigned long flags; unsigned long flags; Loading @@ -328,7 +328,7 @@ static inline void ata_exec(struct ata_port *ap, struct ata_taskfile *tf) * Obtains host_set lock. * Obtains host_set lock. */ */ static void ata_tf_to_host(struct ata_port *ap, struct ata_taskfile *tf) static void ata_tf_to_host(struct ata_port *ap, const struct ata_taskfile *tf) { { ap->ops->tf_load(ap, tf); ap->ops->tf_load(ap, tf); Loading @@ -348,7 +348,7 @@ static void ata_tf_to_host(struct ata_port *ap, struct ata_taskfile *tf) * spin_lock_irqsave(host_set lock) * spin_lock_irqsave(host_set lock) */ */ void ata_tf_to_host_nolock(struct ata_port *ap, struct ata_taskfile *tf) void ata_tf_to_host_nolock(struct ata_port *ap, const struct ata_taskfile *tf) { { ap->ops->tf_load(ap, tf); ap->ops->tf_load(ap, tf); ap->ops->exec_command(ap, tf); ap->ops->exec_command(ap, tf); Loading Loading @@ -558,7 +558,7 @@ u8 ata_chk_err(struct ata_port *ap) * Inherited from caller. * Inherited from caller. */ */ void ata_tf_to_fis(struct ata_taskfile *tf, u8 *fis, u8 pmp) void ata_tf_to_fis(const struct ata_taskfile *tf, u8 *fis, u8 pmp) { { fis[0] = 0x27; /* Register - Host to Device FIS */ fis[0] = 0x27; /* Register - Host to Device FIS */ fis[1] = (pmp & 0xf) | (1 << 7); /* Port multiplier number, fis[1] = (pmp & 0xf) | (1 << 7); /* Port multiplier number, Loading Loading @@ -599,7 +599,7 @@ void ata_tf_to_fis(struct ata_taskfile *tf, u8 *fis, u8 pmp) * Inherited from caller. * Inherited from caller. */ */ void ata_tf_from_fis(u8 *fis, struct ata_taskfile *tf) void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf) { { tf->command = fis[2]; /* status */ tf->command = fis[2]; /* status */ tf->feature = fis[3]; /* error */ tf->feature = fis[3]; /* error */ Loading Loading @@ -845,7 +845,7 @@ static unsigned int ata_devchk(struct ata_port *ap, * the event of failure. * the event of failure. */ */ unsigned int ata_dev_classify(struct ata_taskfile *tf) unsigned int ata_dev_classify(const struct ata_taskfile *tf) { { /* Apple's open source Darwin code hints that some devices only /* Apple's open source Darwin code hints that some devices only * put a proper signature into the LBA mid/high registers, * put a proper signature into the LBA mid/high registers, Loading Loading @@ -937,7 +937,7 @@ static u8 ata_dev_try_classify(struct ata_port *ap, unsigned int device) * caller. * caller. */ */ void ata_dev_id_string(u16 *id, unsigned char *s, void ata_dev_id_string(const u16 *id, unsigned char *s, unsigned int ofs, unsigned int len) unsigned int ofs, unsigned int len) { { unsigned int c; unsigned int c; Loading Loading @@ -1054,7 +1054,7 @@ void ata_dev_select(struct ata_port *ap, unsigned int device, * caller. * caller. */ */ static inline void ata_dump_id(struct ata_device *dev) static inline void ata_dump_id(const struct ata_device *dev) { { DPRINTK("49==0x%04x " DPRINTK("49==0x%04x " "53==0x%04x " "53==0x%04x " Loading Loading @@ -1089,7 +1089,7 @@ static inline void ata_dump_id(struct ata_device *dev) * FIXME: pre IDE drive timing (do we care ?). * FIXME: pre IDE drive timing (do we care ?). */ */ static unsigned int ata_pio_modes(struct ata_device *adev) static unsigned int ata_pio_modes(const struct ata_device *adev) { { u16 modes; u16 modes; Loading Loading @@ -1352,7 +1352,7 @@ static void ata_dev_identify(struct ata_port *ap, unsigned int device) } } static inline u8 ata_dev_knobble(struct ata_port *ap) static inline u8 ata_dev_knobble(const struct ata_port *ap) { { return ((ap->cbl == ATA_CBL_SATA) && (!ata_id_is_sata(ap->device->id))); return ((ap->cbl == ATA_CBL_SATA) && (!ata_id_is_sata(ap->device->id))); } } Loading Loading @@ -1684,7 +1684,7 @@ int ata_timing_compute(struct ata_device *adev, unsigned short speed, return 0; return 0; } } static struct { static const struct { unsigned int shift; unsigned int shift; u8 base; u8 base; } xfer_mode_classes[] = { } xfer_mode_classes[] = { Loading Loading @@ -2093,7 +2093,8 @@ void ata_bus_reset(struct ata_port *ap) DPRINTK("EXIT\n"); DPRINTK("EXIT\n"); } } static void ata_pr_blacklisted(struct ata_port *ap, struct ata_device *dev) static void ata_pr_blacklisted(const struct ata_port *ap, const struct ata_device *dev) { { printk(KERN_WARNING "ata%u: dev %u is on DMA blacklist, disabling DMA\n", printk(KERN_WARNING "ata%u: dev %u is on DMA blacklist, disabling DMA\n", ap->id, dev->devno); ap->id, dev->devno); Loading Loading @@ -2131,7 +2132,7 @@ static const char * ata_dma_blacklist [] = { "_NEC DV5800A", "_NEC DV5800A", }; }; static int ata_dma_blacklisted(struct ata_port *ap, struct ata_device *dev) static int ata_dma_blacklisted(const struct ata_device *dev) { { unsigned char model_num[40]; unsigned char model_num[40]; char *s; char *s; Loading @@ -2156,9 +2157,9 @@ static int ata_dma_blacklisted(struct ata_port *ap, struct ata_device *dev) return 0; return 0; } } static unsigned int ata_get_mode_mask(struct ata_port *ap, int shift) static unsigned int ata_get_mode_mask(const struct ata_port *ap, int shift) { { struct ata_device *master, *slave; const struct ata_device *master, *slave; unsigned int mask; unsigned int mask; master = &ap->device[0]; master = &ap->device[0]; Loading @@ -2170,14 +2171,14 @@ static unsigned int ata_get_mode_mask(struct ata_port *ap, int shift) mask = ap->udma_mask; mask = ap->udma_mask; if (ata_dev_present(master)) { if (ata_dev_present(master)) { mask &= (master->id[ATA_ID_UDMA_MODES] & 0xff); mask &= (master->id[ATA_ID_UDMA_MODES] & 0xff); if (ata_dma_blacklisted(ap, master)) { if (ata_dma_blacklisted(master)) { mask = 0; mask = 0; ata_pr_blacklisted(ap, master); ata_pr_blacklisted(ap, master); } } } } if (ata_dev_present(slave)) { if (ata_dev_present(slave)) { mask &= (slave->id[ATA_ID_UDMA_MODES] & 0xff); mask &= (slave->id[ATA_ID_UDMA_MODES] & 0xff); if (ata_dma_blacklisted(ap, slave)) { if (ata_dma_blacklisted(slave)) { mask = 0; mask = 0; ata_pr_blacklisted(ap, slave); ata_pr_blacklisted(ap, slave); } } Loading @@ -2187,14 +2188,14 @@ static unsigned int ata_get_mode_mask(struct ata_port *ap, int shift) mask = ap->mwdma_mask; mask = ap->mwdma_mask; if (ata_dev_present(master)) { if (ata_dev_present(master)) { mask &= (master->id[ATA_ID_MWDMA_MODES] & 0x07); mask &= (master->id[ATA_ID_MWDMA_MODES] & 0x07); if (ata_dma_blacklisted(ap, master)) { if (ata_dma_blacklisted(master)) { mask = 0; mask = 0; ata_pr_blacklisted(ap, master); ata_pr_blacklisted(ap, master); } } } } if (ata_dev_present(slave)) { if (ata_dev_present(slave)) { mask &= (slave->id[ATA_ID_MWDMA_MODES] & 0x07); mask &= (slave->id[ATA_ID_MWDMA_MODES] & 0x07); if (ata_dma_blacklisted(ap, slave)) { if (ata_dma_blacklisted(slave)) { mask = 0; mask = 0; ata_pr_blacklisted(ap, slave); ata_pr_blacklisted(ap, slave); } } Loading Loading @@ -2258,7 +2259,7 @@ static int fgb(u32 bitmap) * Zero on success, negative on error. * Zero on success, negative on error. */ */ static int ata_choose_xfer_mode(struct ata_port *ap, static int ata_choose_xfer_mode(const struct ata_port *ap, u8 *xfer_mode_out, u8 *xfer_mode_out, unsigned int *xfer_shift_out) unsigned int *xfer_shift_out) { { Loading Loading @@ -4144,7 +4145,7 @@ static void ata_host_remove(struct ata_port *ap, unsigned int do_unregister) static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host, static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host, struct ata_host_set *host_set, struct ata_host_set *host_set, struct ata_probe_ent *ent, unsigned int port_no) const struct ata_probe_ent *ent, unsigned int port_no) { { unsigned int i; unsigned int i; Loading Loading @@ -4203,7 +4204,7 @@ static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host, * * */ */ static struct ata_port * ata_host_add(struct ata_probe_ent *ent, static struct ata_port * ata_host_add(const struct ata_probe_ent *ent, struct ata_host_set *host_set, struct ata_host_set *host_set, unsigned int port_no) unsigned int port_no) { { Loading Loading @@ -4251,7 +4252,7 @@ static struct ata_port * ata_host_add(struct ata_probe_ent *ent, * * */ */ int ata_device_add(struct ata_probe_ent *ent) int ata_device_add(const struct ata_probe_ent *ent) { { unsigned int count = 0, i; unsigned int count = 0, i; struct device *dev = ent->dev; struct device *dev = ent->dev; Loading Loading @@ -4470,7 +4471,7 @@ void ata_std_ports(struct ata_ioports *ioaddr) } } static struct ata_probe_ent * static struct ata_probe_ent * ata_probe_ent_alloc(struct device *dev, struct ata_port_info *port) ata_probe_ent_alloc(struct device *dev, const struct ata_port_info *port) { { struct ata_probe_ent *probe_ent; struct ata_probe_ent *probe_ent; Loading Loading @@ -4570,7 +4571,6 @@ static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev, stru if (!probe_ent) if (!probe_ent) return NULL; return NULL; probe_ent->legacy_mode = 1; probe_ent->legacy_mode = 1; probe_ent->n_ports = 1; probe_ent->n_ports = 1; probe_ent->hard_port_no = port_num; probe_ent->hard_port_no = port_num; Loading Loading @@ -4783,7 +4783,7 @@ void ata_pci_remove_one (struct pci_dev *pdev) } } /* move to PCI subsystem */ /* move to PCI subsystem */ int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits) int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits) { { unsigned long tmp = 0; unsigned long tmp = 0; Loading
drivers/scsi/libata-scsi.c +12 −12 Original line number Original line Diff line number Diff line Loading @@ -44,9 +44,9 @@ #include "libata.h" #include "libata.h" typedef unsigned int (*ata_xlat_func_t)(struct ata_queued_cmd *qc, u8 *scsicmd); typedef unsigned int (*ata_xlat_func_t)(struct ata_queued_cmd *qc, const u8 *scsicmd); static struct ata_device * static struct ata_device * ata_scsi_find_dev(struct ata_port *ap, struct scsi_device *scsidev); ata_scsi_find_dev(struct ata_port *ap, const struct scsi_device *scsidev); static void ata_scsi_invalid_field(struct scsi_cmnd *cmd, static void ata_scsi_invalid_field(struct scsi_cmnd *cmd, Loading Loading @@ -418,7 +418,7 @@ int ata_scsi_error(struct Scsi_Host *host) */ */ static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc, static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc, u8 *scsicmd) const u8 *scsicmd) { { struct ata_taskfile *tf = &qc->tf; struct ata_taskfile *tf = &qc->tf; Loading Loading @@ -485,7 +485,7 @@ static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc, * Zero on success, non-zero on error. * Zero on success, non-zero on error. */ */ static unsigned int ata_scsi_flush_xlat(struct ata_queued_cmd *qc, u8 *scsicmd) static unsigned int ata_scsi_flush_xlat(struct ata_queued_cmd *qc, const u8 *scsicmd) { { struct ata_taskfile *tf = &qc->tf; struct ata_taskfile *tf = &qc->tf; Loading @@ -512,7 +512,7 @@ static unsigned int ata_scsi_flush_xlat(struct ata_queued_cmd *qc, u8 *scsicmd) * @plen: the transfer length * @plen: the transfer length */ */ static void scsi_6_lba_len(u8 *scsicmd, u64 *plba, u32 *plen) static void scsi_6_lba_len(const u8 *scsicmd, u64 *plba, u32 *plen) { { u64 lba = 0; u64 lba = 0; u32 len = 0; u32 len = 0; Loading @@ -539,7 +539,7 @@ static void scsi_6_lba_len(u8 *scsicmd, u64 *plba, u32 *plen) * @plen: the transfer length * @plen: the transfer length */ */ static void scsi_10_lba_len(u8 *scsicmd, u64 *plba, u32 *plen) static void scsi_10_lba_len(const u8 *scsicmd, u64 *plba, u32 *plen) { { u64 lba = 0; u64 lba = 0; u32 len = 0; u32 len = 0; Loading Loading @@ -569,7 +569,7 @@ static void scsi_10_lba_len(u8 *scsicmd, u64 *plba, u32 *plen) * @plen: the transfer length * @plen: the transfer length */ */ static void scsi_16_lba_len(u8 *scsicmd, u64 *plba, u32 *plen) static void scsi_16_lba_len(const u8 *scsicmd, u64 *plba, u32 *plen) { { u64 lba = 0; u64 lba = 0; u32 len = 0; u32 len = 0; Loading Loading @@ -608,7 +608,7 @@ static void scsi_16_lba_len(u8 *scsicmd, u64 *plba, u32 *plen) * Zero on success, non-zero on error. * Zero on success, non-zero on error. */ */ static unsigned int ata_scsi_verify_xlat(struct ata_queued_cmd *qc, u8 *scsicmd) static unsigned int ata_scsi_verify_xlat(struct ata_queued_cmd *qc, const u8 *scsicmd) { { struct ata_taskfile *tf = &qc->tf; struct ata_taskfile *tf = &qc->tf; struct ata_device *dev = qc->dev; struct ata_device *dev = qc->dev; Loading Loading @@ -734,7 +734,7 @@ static unsigned int ata_scsi_verify_xlat(struct ata_queued_cmd *qc, u8 *scsicmd) * Zero on success, non-zero on error. * Zero on success, non-zero on error. */ */ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, u8 *scsicmd) static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, const u8 *scsicmd) { { struct ata_taskfile *tf = &qc->tf; struct ata_taskfile *tf = &qc->tf; struct ata_device *dev = qc->dev; struct ata_device *dev = qc->dev; Loading Loading @@ -1688,7 +1688,7 @@ static int atapi_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat) * Zero on success, non-zero on failure. * Zero on success, non-zero on failure. */ */ static unsigned int atapi_xlat(struct ata_queued_cmd *qc, u8 *scsicmd) static unsigned int atapi_xlat(struct ata_queued_cmd *qc, const u8 *scsicmd) { { struct scsi_cmnd *cmd = qc->scsicmd; struct scsi_cmnd *cmd = qc->scsicmd; struct ata_device *dev = qc->dev; struct ata_device *dev = qc->dev; Loading Loading @@ -1757,7 +1757,7 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc, u8 *scsicmd) */ */ static struct ata_device * static struct ata_device * ata_scsi_find_dev(struct ata_port *ap, struct scsi_device *scsidev) ata_scsi_find_dev(struct ata_port *ap, const struct scsi_device *scsidev) { { struct ata_device *dev; struct ata_device *dev; Loading Loading @@ -1914,7 +1914,7 @@ void ata_scsi_simulate(u16 *id, void (*done)(struct scsi_cmnd *)) void (*done)(struct scsi_cmnd *)) { { struct ata_scsi_args args; struct ata_scsi_args args; u8 *scsicmd = cmd->cmnd; const u8 *scsicmd = cmd->cmnd; args.id = id; args.id = id; args.cmd = cmd; args.cmd = cmd; Loading
drivers/scsi/libata.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -48,7 +48,7 @@ extern int ata_qc_issue(struct ata_queued_cmd *qc); extern int ata_check_atapi_dma(struct ata_queued_cmd *qc); extern int ata_check_atapi_dma(struct ata_queued_cmd *qc); extern void ata_dev_select(struct ata_port *ap, unsigned int device, extern void ata_dev_select(struct ata_port *ap, unsigned int device, unsigned int wait, unsigned int can_sleep); unsigned int wait, unsigned int can_sleep); extern void ata_tf_to_host_nolock(struct ata_port *ap, struct ata_taskfile *tf); extern void ata_tf_to_host_nolock(struct ata_port *ap, const struct ata_taskfile *tf); extern void swap_buf_le16(u16 *buf, unsigned int buf_words); extern void swap_buf_le16(u16 *buf, unsigned int buf_words); Loading