diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-10-22 14:27:05 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-22 14:27:05 -0400 |
commit | 057ace5e79da9ebf2aa82833cfea825533ac06fb (patch) | |
tree | f27ed6cbd9a185041862471ef421e6415e099344 /drivers/scsi/libata-scsi.c | |
parent | cf482935c6abe5245e481213c6e6df808c976f56 (diff) |
libata: const-ification bombing run
Enforce access rules where appropriate.
If the compiler is smart enough, this may buy us an optimization or two
as a side effect.
Diffstat (limited to 'drivers/scsi/libata-scsi.c')
-rw-r--r-- | drivers/scsi/libata-scsi.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c index 90bf22204668..58858886d751 100644 --- a/drivers/scsi/libata-scsi.c +++ b/drivers/scsi/libata-scsi.c | |||
@@ -44,9 +44,9 @@ | |||
44 | 44 | ||
45 | #include "libata.h" | 45 | #include "libata.h" |
46 | 46 | ||
47 | typedef unsigned int (*ata_xlat_func_t)(struct ata_queued_cmd *qc, u8 *scsicmd); | 47 | typedef unsigned int (*ata_xlat_func_t)(struct ata_queued_cmd *qc, const u8 *scsicmd); |
48 | static struct ata_device * | 48 | static struct ata_device * |
49 | ata_scsi_find_dev(struct ata_port *ap, struct scsi_device *scsidev); | 49 | ata_scsi_find_dev(struct ata_port *ap, const struct scsi_device *scsidev); |
50 | 50 | ||
51 | 51 | ||
52 | static void ata_scsi_invalid_field(struct scsi_cmnd *cmd, | 52 | static void ata_scsi_invalid_field(struct scsi_cmnd *cmd, |
@@ -418,7 +418,7 @@ int ata_scsi_error(struct Scsi_Host *host) | |||
418 | */ | 418 | */ |
419 | 419 | ||
420 | static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc, | 420 | static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc, |
421 | u8 *scsicmd) | 421 | const u8 *scsicmd) |
422 | { | 422 | { |
423 | struct ata_taskfile *tf = &qc->tf; | 423 | struct ata_taskfile *tf = &qc->tf; |
424 | 424 | ||
@@ -485,7 +485,7 @@ invalid_fld: | |||
485 | * Zero on success, non-zero on error. | 485 | * Zero on success, non-zero on error. |
486 | */ | 486 | */ |
487 | 487 | ||
488 | static unsigned int ata_scsi_flush_xlat(struct ata_queued_cmd *qc, u8 *scsicmd) | 488 | static unsigned int ata_scsi_flush_xlat(struct ata_queued_cmd *qc, const u8 *scsicmd) |
489 | { | 489 | { |
490 | struct ata_taskfile *tf = &qc->tf; | 490 | struct ata_taskfile *tf = &qc->tf; |
491 | 491 | ||
@@ -512,7 +512,7 @@ static unsigned int ata_scsi_flush_xlat(struct ata_queued_cmd *qc, u8 *scsicmd) | |||
512 | * @plen: the transfer length | 512 | * @plen: the transfer length |
513 | */ | 513 | */ |
514 | 514 | ||
515 | static void scsi_6_lba_len(u8 *scsicmd, u64 *plba, u32 *plen) | 515 | static void scsi_6_lba_len(const u8 *scsicmd, u64 *plba, u32 *plen) |
516 | { | 516 | { |
517 | u64 lba = 0; | 517 | u64 lba = 0; |
518 | u32 len = 0; | 518 | u32 len = 0; |
@@ -539,7 +539,7 @@ static void scsi_6_lba_len(u8 *scsicmd, u64 *plba, u32 *plen) | |||
539 | * @plen: the transfer length | 539 | * @plen: the transfer length |
540 | */ | 540 | */ |
541 | 541 | ||
542 | static void scsi_10_lba_len(u8 *scsicmd, u64 *plba, u32 *plen) | 542 | static void scsi_10_lba_len(const u8 *scsicmd, u64 *plba, u32 *plen) |
543 | { | 543 | { |
544 | u64 lba = 0; | 544 | u64 lba = 0; |
545 | u32 len = 0; | 545 | u32 len = 0; |
@@ -569,7 +569,7 @@ static void scsi_10_lba_len(u8 *scsicmd, u64 *plba, u32 *plen) | |||
569 | * @plen: the transfer length | 569 | * @plen: the transfer length |
570 | */ | 570 | */ |
571 | 571 | ||
572 | static void scsi_16_lba_len(u8 *scsicmd, u64 *plba, u32 *plen) | 572 | static void scsi_16_lba_len(const u8 *scsicmd, u64 *plba, u32 *plen) |
573 | { | 573 | { |
574 | u64 lba = 0; | 574 | u64 lba = 0; |
575 | u32 len = 0; | 575 | u32 len = 0; |
@@ -608,7 +608,7 @@ static void scsi_16_lba_len(u8 *scsicmd, u64 *plba, u32 *plen) | |||
608 | * Zero on success, non-zero on error. | 608 | * Zero on success, non-zero on error. |
609 | */ | 609 | */ |
610 | 610 | ||
611 | static unsigned int ata_scsi_verify_xlat(struct ata_queued_cmd *qc, u8 *scsicmd) | 611 | static unsigned int ata_scsi_verify_xlat(struct ata_queued_cmd *qc, const u8 *scsicmd) |
612 | { | 612 | { |
613 | struct ata_taskfile *tf = &qc->tf; | 613 | struct ata_taskfile *tf = &qc->tf; |
614 | struct ata_device *dev = qc->dev; | 614 | struct ata_device *dev = qc->dev; |
@@ -734,7 +734,7 @@ nothing_to_do: | |||
734 | * Zero on success, non-zero on error. | 734 | * Zero on success, non-zero on error. |
735 | */ | 735 | */ |
736 | 736 | ||
737 | static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, u8 *scsicmd) | 737 | static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, const u8 *scsicmd) |
738 | { | 738 | { |
739 | struct ata_taskfile *tf = &qc->tf; | 739 | struct ata_taskfile *tf = &qc->tf; |
740 | struct ata_device *dev = qc->dev; | 740 | struct ata_device *dev = qc->dev; |
@@ -1688,7 +1688,7 @@ static int atapi_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat) | |||
1688 | * Zero on success, non-zero on failure. | 1688 | * Zero on success, non-zero on failure. |
1689 | */ | 1689 | */ |
1690 | 1690 | ||
1691 | static unsigned int atapi_xlat(struct ata_queued_cmd *qc, u8 *scsicmd) | 1691 | static unsigned int atapi_xlat(struct ata_queued_cmd *qc, const u8 *scsicmd) |
1692 | { | 1692 | { |
1693 | struct scsi_cmnd *cmd = qc->scsicmd; | 1693 | struct scsi_cmnd *cmd = qc->scsicmd; |
1694 | struct ata_device *dev = qc->dev; | 1694 | struct ata_device *dev = qc->dev; |
@@ -1757,7 +1757,7 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc, u8 *scsicmd) | |||
1757 | */ | 1757 | */ |
1758 | 1758 | ||
1759 | static struct ata_device * | 1759 | static struct ata_device * |
1760 | ata_scsi_find_dev(struct ata_port *ap, struct scsi_device *scsidev) | 1760 | ata_scsi_find_dev(struct ata_port *ap, const struct scsi_device *scsidev) |
1761 | { | 1761 | { |
1762 | struct ata_device *dev; | 1762 | struct ata_device *dev; |
1763 | 1763 | ||
@@ -1914,7 +1914,7 @@ void ata_scsi_simulate(u16 *id, | |||
1914 | void (*done)(struct scsi_cmnd *)) | 1914 | void (*done)(struct scsi_cmnd *)) |
1915 | { | 1915 | { |
1916 | struct ata_scsi_args args; | 1916 | struct ata_scsi_args args; |
1917 | u8 *scsicmd = cmd->cmnd; | 1917 | const u8 *scsicmd = cmd->cmnd; |
1918 | 1918 | ||
1919 | args.id = id; | 1919 | args.id = id; |
1920 | args.cmd = cmd; | 1920 | args.cmd = cmd; |