diff options
author | Finn Thain <fthain@telegraphics.com.au> | 2014-11-12 00:11:52 -0500 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-11-20 03:11:05 -0500 |
commit | 4d3d2a54f731aa25f66adcf934ba9a55ca8204d4 (patch) | |
tree | 99ddb1b68ec6d13a81550f07f4d877b1bea81df4 /drivers | |
parent | ed8b9e7f1827ebae902e868866438d1bcdbef0a2 (diff) |
ncr5380: Remove more useless prototypes
Make use of the host template static initializer instead of assigning
handlers at run-time. Move __maybe_unused qualifiers from declarations
to definitions. Move the atari_scsi_bus_reset() wrapper after the
definition of NCR5380_bus_reset(). All of the host template handler
prototypes are now redundant so remove them.
The write_info() handler is only relevant to drivers using PSEUDO_DMA so
this patch fixes the compiler warning in atari_NCR5380.c and sun3_NCR5380.c:
CC drivers/scsi/atari_scsi.o
drivers/scsi/NCR5380.h:329: warning: 'NCR5380_write_info' declared 'static' but never defined
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Tested-by: Michael Schmitz <schmitzmic@gmail.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/NCR5380.h | 8 | ||||
-rw-r--r-- | drivers/scsi/atari_NCR5380.c | 3 | ||||
-rw-r--r-- | drivers/scsi/atari_scsi.c | 76 | ||||
-rw-r--r-- | drivers/scsi/dtc.c | 7 | ||||
-rw-r--r-- | drivers/scsi/pas16.c | 7 | ||||
-rw-r--r-- | drivers/scsi/sun3_NCR5380.c | 3 | ||||
-rw-r--r-- | drivers/scsi/t128.c | 7 |
7 files changed, 50 insertions, 61 deletions
diff --git a/drivers/scsi/NCR5380.h b/drivers/scsi/NCR5380.h index 8b96b687885b..b1ed20aaf10e 100644 --- a/drivers/scsi/NCR5380.h +++ b/drivers/scsi/NCR5380.h | |||
@@ -322,14 +322,6 @@ static irqreturn_t NCR5380_intr(int irq, void *dev_id); | |||
322 | #endif | 322 | #endif |
323 | static void NCR5380_main(struct work_struct *work); | 323 | static void NCR5380_main(struct work_struct *work); |
324 | static void __maybe_unused NCR5380_print_options(struct Scsi_Host *instance); | 324 | static void __maybe_unused NCR5380_print_options(struct Scsi_Host *instance); |
325 | static int NCR5380_abort(Scsi_Cmnd * cmd); | ||
326 | static int NCR5380_bus_reset(Scsi_Cmnd * cmd); | ||
327 | static int NCR5380_queue_command(struct Scsi_Host *, struct scsi_cmnd *); | ||
328 | static int __maybe_unused NCR5380_show_info(struct seq_file *, | ||
329 | struct Scsi_Host *); | ||
330 | static int __maybe_unused NCR5380_write_info(struct Scsi_Host *instance, | ||
331 | char *buffer, int length); | ||
332 | |||
333 | static void NCR5380_reselect(struct Scsi_Host *instance); | 325 | static void NCR5380_reselect(struct Scsi_Host *instance); |
334 | static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd * cmd, int tag); | 326 | static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd * cmd, int tag); |
335 | #if defined(PSEUDO_DMA) || defined(REAL_DMA) || defined(REAL_DMA_POLL) | 327 | #if defined(PSEUDO_DMA) || defined(REAL_DMA) || defined(REAL_DMA_POLL) |
diff --git a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c index 11e93025b87a..339f238598b1 100644 --- a/drivers/scsi/atari_NCR5380.c +++ b/drivers/scsi/atari_NCR5380.c | |||
@@ -772,7 +772,8 @@ static void show_Scsi_Cmnd(Scsi_Cmnd *cmd, struct seq_file *m) | |||
772 | seq_printf(m, "\n"); | 772 | seq_printf(m, "\n"); |
773 | } | 773 | } |
774 | 774 | ||
775 | static int NCR5380_show_info(struct seq_file *m, struct Scsi_Host *instance) | 775 | static int __maybe_unused NCR5380_show_info(struct seq_file *m, |
776 | struct Scsi_Host *instance) | ||
776 | { | 777 | { |
777 | struct NCR5380_hostdata *hostdata; | 778 | struct NCR5380_hostdata *hostdata; |
778 | Scsi_Cmnd *ptr; | 779 | Scsi_Cmnd *ptr; |
diff --git a/drivers/scsi/atari_scsi.c b/drivers/scsi/atari_scsi.c index 151beea19b9a..a68d6257bc68 100644 --- a/drivers/scsi/atari_scsi.c +++ b/drivers/scsi/atari_scsi.c | |||
@@ -783,45 +783,6 @@ static int __init atari_scsi_setup(char *str) | |||
783 | __setup("atascsi=", atari_scsi_setup); | 783 | __setup("atascsi=", atari_scsi_setup); |
784 | #endif /* !MODULE */ | 784 | #endif /* !MODULE */ |
785 | 785 | ||
786 | static int atari_scsi_bus_reset(Scsi_Cmnd *cmd) | ||
787 | { | ||
788 | int rv; | ||
789 | struct NCR5380_hostdata *hostdata = | ||
790 | (struct NCR5380_hostdata *)cmd->device->host->hostdata; | ||
791 | |||
792 | /* For doing the reset, SCSI interrupts must be disabled first, | ||
793 | * since the 5380 raises its IRQ line while _RST is active and we | ||
794 | * can't disable interrupts completely, since we need the timer. | ||
795 | */ | ||
796 | /* And abort a maybe active DMA transfer */ | ||
797 | if (IS_A_TT()) { | ||
798 | atari_turnoff_irq(IRQ_TT_MFP_SCSI); | ||
799 | #ifdef REAL_DMA | ||
800 | tt_scsi_dma.dma_ctrl = 0; | ||
801 | #endif /* REAL_DMA */ | ||
802 | } else { | ||
803 | atari_turnoff_irq(IRQ_MFP_FSCSI); | ||
804 | #ifdef REAL_DMA | ||
805 | st_dma.dma_mode_status = 0x90; | ||
806 | atari_dma_active = 0; | ||
807 | atari_dma_orig_addr = NULL; | ||
808 | #endif /* REAL_DMA */ | ||
809 | } | ||
810 | |||
811 | rv = NCR5380_bus_reset(cmd); | ||
812 | |||
813 | /* Re-enable ints */ | ||
814 | if (IS_A_TT()) { | ||
815 | atari_turnon_irq(IRQ_TT_MFP_SCSI); | ||
816 | } else { | ||
817 | atari_turnon_irq(IRQ_MFP_FSCSI); | ||
818 | } | ||
819 | if (rv == SUCCESS) | ||
820 | falcon_release_lock_if_possible(hostdata); | ||
821 | |||
822 | return rv; | ||
823 | } | ||
824 | |||
825 | 786 | ||
826 | #ifdef CONFIG_ATARI_SCSI_RESET_BOOT | 787 | #ifdef CONFIG_ATARI_SCSI_RESET_BOOT |
827 | static void __init atari_scsi_reset_boot(void) | 788 | static void __init atari_scsi_reset_boot(void) |
@@ -1094,6 +1055,43 @@ static void atari_scsi_falcon_reg_write(unsigned char reg, unsigned char value) | |||
1094 | 1055 | ||
1095 | #include "atari_NCR5380.c" | 1056 | #include "atari_NCR5380.c" |
1096 | 1057 | ||
1058 | static int atari_scsi_bus_reset(struct scsi_cmnd *cmd) | ||
1059 | { | ||
1060 | int rv; | ||
1061 | struct NCR5380_hostdata *hostdata = shost_priv(cmd->device->host); | ||
1062 | |||
1063 | /* For doing the reset, SCSI interrupts must be disabled first, | ||
1064 | * since the 5380 raises its IRQ line while _RST is active and we | ||
1065 | * can't disable interrupts completely, since we need the timer. | ||
1066 | */ | ||
1067 | /* And abort a maybe active DMA transfer */ | ||
1068 | if (IS_A_TT()) { | ||
1069 | atari_turnoff_irq(IRQ_TT_MFP_SCSI); | ||
1070 | #ifdef REAL_DMA | ||
1071 | tt_scsi_dma.dma_ctrl = 0; | ||
1072 | #endif | ||
1073 | } else { | ||
1074 | atari_turnoff_irq(IRQ_MFP_FSCSI); | ||
1075 | #ifdef REAL_DMA | ||
1076 | st_dma.dma_mode_status = 0x90; | ||
1077 | atari_dma_active = 0; | ||
1078 | atari_dma_orig_addr = NULL; | ||
1079 | #endif | ||
1080 | } | ||
1081 | |||
1082 | rv = NCR5380_bus_reset(cmd); | ||
1083 | |||
1084 | if (IS_A_TT()) | ||
1085 | atari_turnon_irq(IRQ_TT_MFP_SCSI); | ||
1086 | else | ||
1087 | atari_turnon_irq(IRQ_MFP_FSCSI); | ||
1088 | |||
1089 | if (rv == SUCCESS) | ||
1090 | falcon_release_lock_if_possible(hostdata); | ||
1091 | |||
1092 | return rv; | ||
1093 | } | ||
1094 | |||
1097 | static struct scsi_host_template driver_template = { | 1095 | static struct scsi_host_template driver_template = { |
1098 | .show_info = atari_scsi_show_info, | 1096 | .show_info = atari_scsi_show_info, |
1099 | .name = "Atari native SCSI", | 1097 | .name = "Atari native SCSI", |
diff --git a/drivers/scsi/dtc.c b/drivers/scsi/dtc.c index f271fc5f6b82..e890b08efbd8 100644 --- a/drivers/scsi/dtc.c +++ b/drivers/scsi/dtc.c | |||
@@ -219,10 +219,6 @@ static int __init dtc_detect(struct scsi_host_template * tpnt) | |||
219 | void __iomem *base; | 219 | void __iomem *base; |
220 | int sig, count; | 220 | int sig, count; |
221 | 221 | ||
222 | tpnt->proc_name = "dtc3x80"; | ||
223 | tpnt->show_info = dtc_show_info; | ||
224 | tpnt->write_info = dtc_write_info; | ||
225 | |||
226 | for (count = 0; current_override < NO_OVERRIDES; ++current_override) { | 222 | for (count = 0; current_override < NO_OVERRIDES; ++current_override) { |
227 | addr = 0; | 223 | addr = 0; |
228 | base = NULL; | 224 | base = NULL; |
@@ -477,6 +473,9 @@ static struct scsi_host_template driver_template = { | |||
477 | .name = "DTC 3180/3280 ", | 473 | .name = "DTC 3180/3280 ", |
478 | .detect = dtc_detect, | 474 | .detect = dtc_detect, |
479 | .release = dtc_release, | 475 | .release = dtc_release, |
476 | .proc_name = "dtc3x80", | ||
477 | .show_info = dtc_show_info, | ||
478 | .write_info = dtc_write_info, | ||
480 | .queuecommand = dtc_queue_command, | 479 | .queuecommand = dtc_queue_command, |
481 | .eh_abort_handler = dtc_abort, | 480 | .eh_abort_handler = dtc_abort, |
482 | .eh_bus_reset_handler = dtc_bus_reset, | 481 | .eh_bus_reset_handler = dtc_bus_reset, |
diff --git a/drivers/scsi/pas16.c b/drivers/scsi/pas16.c index 736540e789ed..ffa399e7860a 100644 --- a/drivers/scsi/pas16.c +++ b/drivers/scsi/pas16.c | |||
@@ -390,10 +390,6 @@ static int __init pas16_detect(struct scsi_host_template *tpnt) | |||
390 | unsigned short io_port; | 390 | unsigned short io_port; |
391 | int count; | 391 | int count; |
392 | 392 | ||
393 | tpnt->proc_name = "pas16"; | ||
394 | tpnt->show_info = pas16_show_info; | ||
395 | tpnt->write_info = pas16_write_info; | ||
396 | |||
397 | if (pas16_addr != 0) { | 393 | if (pas16_addr != 0) { |
398 | overrides[0].io_port = pas16_addr; | 394 | overrides[0].io_port = pas16_addr; |
399 | /* | 395 | /* |
@@ -620,6 +616,9 @@ static struct scsi_host_template driver_template = { | |||
620 | .name = "Pro Audio Spectrum-16 SCSI", | 616 | .name = "Pro Audio Spectrum-16 SCSI", |
621 | .detect = pas16_detect, | 617 | .detect = pas16_detect, |
622 | .release = pas16_release, | 618 | .release = pas16_release, |
619 | .proc_name = "pas16", | ||
620 | .show_info = pas16_show_info, | ||
621 | .write_info = pas16_write_info, | ||
623 | .queuecommand = pas16_queue_command, | 622 | .queuecommand = pas16_queue_command, |
624 | .eh_abort_handler = pas16_abort, | 623 | .eh_abort_handler = pas16_abort, |
625 | .eh_bus_reset_handler = pas16_bus_reset, | 624 | .eh_bus_reset_handler = pas16_bus_reset, |
diff --git a/drivers/scsi/sun3_NCR5380.c b/drivers/scsi/sun3_NCR5380.c index 835bd8dafe0a..24e90c9776a6 100644 --- a/drivers/scsi/sun3_NCR5380.c +++ b/drivers/scsi/sun3_NCR5380.c | |||
@@ -718,7 +718,8 @@ static void show_Scsi_Cmnd(Scsi_Cmnd *cmd, struct seq_file *m) | |||
718 | seq_printf(m, "\n"); | 718 | seq_printf(m, "\n"); |
719 | } | 719 | } |
720 | 720 | ||
721 | static int NCR5380_show_info(struct seq_file *m, struct Scsi_Host *instance) | 721 | static int __maybe_unused NCR5380_show_info(struct seq_file *m, |
722 | struct Scsi_Host *instance) | ||
722 | { | 723 | { |
723 | struct NCR5380_hostdata *hostdata; | 724 | struct NCR5380_hostdata *hostdata; |
724 | Scsi_Cmnd *ptr; | 725 | Scsi_Cmnd *ptr; |
diff --git a/drivers/scsi/t128.c b/drivers/scsi/t128.c index ccfdc427c4c7..f06ad91d737d 100644 --- a/drivers/scsi/t128.c +++ b/drivers/scsi/t128.c | |||
@@ -201,10 +201,6 @@ static int __init t128_detect(struct scsi_host_template *tpnt) | |||
201 | void __iomem *p; | 201 | void __iomem *p; |
202 | int sig, count; | 202 | int sig, count; |
203 | 203 | ||
204 | tpnt->proc_name = "t128"; | ||
205 | tpnt->show_info = t128_show_info; | ||
206 | tpnt->write_info = t128_write_info; | ||
207 | |||
208 | for (count = 0; current_override < NO_OVERRIDES; ++current_override) { | 204 | for (count = 0; current_override < NO_OVERRIDES; ++current_override) { |
209 | base = 0; | 205 | base = 0; |
210 | p = NULL; | 206 | p = NULL; |
@@ -435,6 +431,9 @@ static struct scsi_host_template driver_template = { | |||
435 | .name = "Trantor T128/T128F/T228", | 431 | .name = "Trantor T128/T128F/T228", |
436 | .detect = t128_detect, | 432 | .detect = t128_detect, |
437 | .release = t128_release, | 433 | .release = t128_release, |
434 | .proc_name = "t128", | ||
435 | .show_info = t128_show_info, | ||
436 | .write_info = t128_write_info, | ||
438 | .queuecommand = t128_queue_command, | 437 | .queuecommand = t128_queue_command, |
439 | .eh_abort_handler = t128_abort, | 438 | .eh_abort_handler = t128_abort, |
440 | .eh_bus_reset_handler = t128_bus_reset, | 439 | .eh_bus_reset_handler = t128_bus_reset, |