diff options
author | Ondrej Zary <linux@rainbow-software.org> | 2015-02-06 17:11:52 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Odin.com> | 2015-04-09 21:09:08 -0400 |
commit | fde1fb8a4a74607c82a47389be9ee3a134c854cb (patch) | |
tree | 3837df20505ebcefd40b17ee90312280adc6856a | |
parent | 2906b3ceb1bfc4a1abd59dd7a5f09268b8d585a6 (diff) |
aha1542: remove DEB macro and simplify debug code
Remove DEB macro and join ifdef DEBUG blocks
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
-rw-r--r-- | drivers/scsi/aha1542.c | 56 |
1 files changed, 22 insertions, 34 deletions
diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c index d607f59f922a..6d4532c5185e 100644 --- a/drivers/scsi/aha1542.c +++ b/drivers/scsi/aha1542.c | |||
@@ -24,11 +24,6 @@ | |||
24 | #include <scsi/scsi_host.h> | 24 | #include <scsi/scsi_host.h> |
25 | #include "aha1542.h" | 25 | #include "aha1542.h" |
26 | 26 | ||
27 | #ifdef DEBUG | ||
28 | #define DEB(x) x | ||
29 | #else | ||
30 | #define DEB(x) | ||
31 | #endif | ||
32 | #define MAXBOARDS 4 | 27 | #define MAXBOARDS 4 |
33 | 28 | ||
34 | static bool isapnp = 1; | 29 | static bool isapnp = 1; |
@@ -195,7 +190,9 @@ static int makecode(unsigned hosterr, unsigned scsierr) | |||
195 | case 0x1a: /* Invalid CCB or Segment List Parameter-A segment list with a zero | 190 | case 0x1a: /* Invalid CCB or Segment List Parameter-A segment list with a zero |
196 | length segment or invalid segment list boundaries was received. | 191 | length segment or invalid segment list boundaries was received. |
197 | A CCB parameter was invalid. */ | 192 | A CCB parameter was invalid. */ |
198 | DEB(printk("Aha1542: %x %x\n", hosterr, scsierr)); | 193 | #ifdef DEBUG |
194 | printk("Aha1542: %x %x\n", hosterr, scsierr); | ||
195 | #endif | ||
199 | hosterr = DID_ERROR; /* Couldn't find any better */ | 196 | hosterr = DID_ERROR; /* Couldn't find any better */ |
200 | break; | 197 | break; |
201 | 198 | ||
@@ -340,11 +337,9 @@ static void aha1542_intr_handle(struct Scsi_Host *sh) | |||
340 | spin_unlock_irqrestore(&aha1542_lock, flags); | 337 | spin_unlock_irqrestore(&aha1542_lock, flags); |
341 | 338 | ||
342 | #ifdef DEBUG | 339 | #ifdef DEBUG |
343 | { | 340 | if (ccb[mbo].tarstat | ccb[mbo].hastat) |
344 | if (ccb[mbo].tarstat | ccb[mbo].hastat) | 341 | shost_printk(KERN_DEBUG, sh, "aha1542_command: returning %x (status %d)\n", |
345 | shost_printk(KERN_DEBUG, sh, "aha1542_command: returning %x (status %d)\n", | 342 | ccb[mbo].tarstat + ((int) ccb[mbo].hastat << 16), mb[mbi].status); |
346 | ccb[mbo].tarstat + ((int) ccb[mbo].hastat << 16), mb[mbi].status); | ||
347 | }; | ||
348 | #endif | 343 | #endif |
349 | 344 | ||
350 | if (mbistatus == 3) | 345 | if (mbistatus == 3) |
@@ -386,26 +381,17 @@ static void aha1542_intr_handle(struct Scsi_Host *sh) | |||
386 | if (errstatus) | 381 | if (errstatus) |
387 | shost_printk(KERN_DEBUG, sh, "(aha1542 error:%x %x %x) ", errstatus, | 382 | shost_printk(KERN_DEBUG, sh, "(aha1542 error:%x %x %x) ", errstatus, |
388 | ccb[mbo].hastat, ccb[mbo].tarstat); | 383 | ccb[mbo].hastat, ccb[mbo].tarstat); |
389 | #endif | ||
390 | |||
391 | if (ccb[mbo].tarstat == 2) { | 384 | if (ccb[mbo].tarstat == 2) { |
392 | #ifdef DEBUG | ||
393 | int i; | 385 | int i; |
394 | #endif | 386 | |
395 | DEB(printk("aha1542_intr_handle: sense:")); | 387 | printk("aha1542_intr_handle: sense:"); |
396 | #ifdef DEBUG | ||
397 | for (i = 0; i < 12; i++) | 388 | for (i = 0; i < 12; i++) |
398 | printk("%02x ", ccb[mbo].cdb[ccb[mbo].cdblen + i]); | 389 | printk("%02x ", ccb[mbo].cdb[ccb[mbo].cdblen + i]); |
399 | printk("\n"); | 390 | printk("\n"); |
400 | #endif | ||
401 | /* | ||
402 | DEB(printk("aha1542_intr_handle: buf:")); | ||
403 | for (i = 0; i < bufflen; i++) | ||
404 | printk("%02x ", ((unchar *)buff)[i]); | ||
405 | printk("\n"); | ||
406 | */ | ||
407 | } | 391 | } |
408 | DEB(if (errstatus) printk("aha1542_intr_handle: returning %6x\n", errstatus)); | 392 | if (errstatus) |
393 | printk("aha1542_intr_handle: returning %6x\n", errstatus); | ||
394 | #endif | ||
409 | tmp_cmd->result = errstatus; | 395 | tmp_cmd->result = errstatus; |
410 | aha1542->int_cmds[mbo] = NULL; /* This effectively frees up the mailbox slot, as | 396 | aha1542->int_cmds[mbo] = NULL; /* This effectively frees up the mailbox slot, as |
411 | far as queuecommand is concerned */ | 397 | far as queuecommand is concerned */ |
@@ -438,15 +424,15 @@ static int aha1542_queuecommand_lck(struct scsi_cmnd *cmd, void (*done) (struct | |||
438 | int mbo; | 424 | int mbo; |
439 | struct mailbox *mb = aha1542->mb; | 425 | struct mailbox *mb = aha1542->mb; |
440 | struct ccb *ccb = aha1542->ccb; | 426 | struct ccb *ccb = aha1542->ccb; |
427 | #ifdef DEBUG | ||
428 | int i; | ||
441 | 429 | ||
442 | DEB(int i); | 430 | if (target > 1) { |
443 | 431 | cmd->result = DID_TIME_OUT << 16; | |
444 | DEB(if (target > 1) { | 432 | done(cmd); |
445 | cmd->result = DID_TIME_OUT << 16; | 433 | return 0; |
446 | done(cmd); return 0; | 434 | } |
447 | } | 435 | #endif |
448 | ); | ||
449 | |||
450 | if (*cmd->cmnd == REQUEST_SENSE) { | 436 | if (*cmd->cmnd == REQUEST_SENSE) { |
451 | /* Don't do the command - we have the sense data already */ | 437 | /* Don't do the command - we have the sense data already */ |
452 | cmd->result = 0; | 438 | cmd->result = 0; |
@@ -564,7 +550,9 @@ static int aha1542_queuecommand_lck(struct scsi_cmnd *cmd, void (*done) (struct | |||
564 | #endif | 550 | #endif |
565 | 551 | ||
566 | if (done) { | 552 | if (done) { |
567 | DEB(printk("aha1542_queuecommand: now waiting for interrupt ")); | 553 | #ifdef DEBUG |
554 | printk("aha1542_queuecommand: now waiting for interrupt "); | ||
555 | #endif | ||
568 | cmd->scsi_done = done; | 556 | cmd->scsi_done = done; |
569 | mb[mbo].status = 1; | 557 | mb[mbo].status = 1; |
570 | aha1542_outb(cmd->device->host->io_port, CMD_START_SCSI); | 558 | aha1542_outb(cmd->device->host->io_port, CMD_START_SCSI); |