summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2017-01-15 18:50:57 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2017-01-31 21:37:44 -0500
commit9507037304e581493bcd8bf76e013e44be71470e (patch)
tree844dfa7cb4abd2a7affb40d40cbad1da4b8d979d
parent090284610632bb32a5d2eea41420ee7c2b6975ca (diff)
scsi: ncr5380: Clean up dead code and redundant macro usage
Remove dead code inside #if 0 conditionals. Remove the #ifdef __KERNEL__ test, since NCR5380.h has no definitions that relate to userspace code. Remove two redundant macro definitions which were overlooked in commit e9db3198e08b ("sun3_scsi: Adopt NCR5380.c core driver"). Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Tested-by: Ondrej Zary <linux@rainbow-software.org> Tested-by: Michael Schmitz <schmitzmic@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/scsi/NCR5380.h7
-rw-r--r--drivers/scsi/atari_scsi.c31
-rw-r--r--drivers/scsi/sun3_scsi.c3
3 files changed, 0 insertions, 41 deletions
diff --git a/drivers/scsi/NCR5380.h b/drivers/scsi/NCR5380.h
index e61d9f9987fa..d78f0957d865 100644
--- a/drivers/scsi/NCR5380.h
+++ b/drivers/scsi/NCR5380.h
@@ -166,11 +166,7 @@
166#define CSR_SCSI_BUF_RDY 0x02 /* ro SCSI buffer read */ 166#define CSR_SCSI_BUF_RDY 0x02 /* ro SCSI buffer read */
167#define CSR_GATED_53C80_IRQ 0x01 /* ro Last block xferred */ 167#define CSR_GATED_53C80_IRQ 0x01 /* ro Last block xferred */
168 168
169#if 0
170#define CSR_BASE CSR_SCSI_BUFF_INTR | CSR_53C80_INTR
171#else
172#define CSR_BASE CSR_53C80_INTR 169#define CSR_BASE CSR_53C80_INTR
173#endif
174 170
175/* Note : PHASE_* macros are based on the values of the STATUS register */ 171/* Note : PHASE_* macros are based on the values of the STATUS register */
176#define PHASE_MASK (SR_MSG | SR_CD | SR_IO) 172#define PHASE_MASK (SR_MSG | SR_CD | SR_IO)
@@ -229,8 +225,6 @@ struct NCR5380_hostdata {
229 char info[168]; /* Host banner message */ 225 char info[168]; /* Host banner message */
230}; 226};
231 227
232#ifdef __KERNEL__
233
234struct NCR5380_cmd { 228struct NCR5380_cmd {
235 struct list_head list; 229 struct list_head list;
236}; 230};
@@ -323,5 +317,4 @@ static inline int NCR5380_dma_residual_none(struct NCR5380_hostdata *hostdata)
323 return 0; 317 return 0;
324} 318}
325 319
326#endif /* __KERNEL__ */
327#endif /* NCR5380_H */ 320#endif /* NCR5380_H */
diff --git a/drivers/scsi/atari_scsi.c b/drivers/scsi/atari_scsi.c
index 105b35393ce9..2b6eb7c24c69 100644
--- a/drivers/scsi/atari_scsi.c
+++ b/drivers/scsi/atari_scsi.c
@@ -178,37 +178,6 @@ static int scsi_dma_is_ignored_buserr(unsigned char dma_stat)
178} 178}
179 179
180 180
181#if 0
182/* Dead code... wasn't called anyway :-) and causes some trouble, because at
183 * end-of-DMA, both SCSI ints are triggered simultaneously, so the NCR int has
184 * to clear the DMA int pending bit before it allows other level 6 interrupts.
185 */
186static void scsi_dma_buserr(int irq, void *dummy)
187{
188 unsigned char dma_stat = tt_scsi_dma.dma_ctrl;
189
190 /* Don't do anything if a NCR interrupt is pending. Probably it's just
191 * masked... */
192 if (atari_irq_pending(IRQ_TT_MFP_SCSI))
193 return;
194
195 printk("Bad SCSI DMA interrupt! dma_addr=0x%08lx dma_stat=%02x dma_cnt=%08lx\n",
196 SCSI_DMA_READ_P(dma_addr), dma_stat, SCSI_DMA_READ_P(dma_cnt));
197 if (dma_stat & 0x80) {
198 if (!scsi_dma_is_ignored_buserr(dma_stat))
199 printk("SCSI DMA bus error -- bad DMA programming!\n");
200 } else {
201 /* Under normal circumstances we never should get to this point,
202 * since both interrupts are triggered simultaneously and the 5380
203 * int has higher priority. When this irq is handled, that DMA
204 * interrupt is cleared. So a warning message is printed here.
205 */
206 printk("SCSI DMA intr ?? -- this shouldn't happen!\n");
207 }
208}
209#endif
210
211
212static irqreturn_t scsi_tt_intr(int irq, void *dev) 181static irqreturn_t scsi_tt_intr(int irq, void *dev)
213{ 182{
214 struct Scsi_Host *instance = dev; 183 struct Scsi_Host *instance = dev;
diff --git a/drivers/scsi/sun3_scsi.c b/drivers/scsi/sun3_scsi.c
index 88db6992420e..166f466964c4 100644
--- a/drivers/scsi/sun3_scsi.c
+++ b/drivers/scsi/sun3_scsi.c
@@ -56,9 +56,6 @@
56#define NCR5380_dma_send_setup sun3scsi_dma_count 56#define NCR5380_dma_send_setup sun3scsi_dma_count
57#define NCR5380_dma_residual sun3scsi_dma_residual 57#define NCR5380_dma_residual sun3scsi_dma_residual
58 58
59#define NCR5380_acquire_dma_irq(instance) (1)
60#define NCR5380_release_dma_irq(instance)
61
62#include "NCR5380.h" 59#include "NCR5380.h"
63 60
64 61