Commit fde1fb8a authored by Ondrej Zary's avatar Ondrej Zary Committed by James Bottomley

aha1542: remove DEB macro and simplify debug code

Remove DEB macro and join ifdef DEBUG blocks
Signed-off-by: default avatarOndrej Zary <linux@rainbow-software.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJames Bottomley <JBottomley@Odin.com>
parent 2906b3ce
...@@ -24,11 +24,6 @@ ...@@ -24,11 +24,6 @@
#include <scsi/scsi_host.h> #include <scsi/scsi_host.h>
#include "aha1542.h" #include "aha1542.h"
#ifdef DEBUG
#define DEB(x) x
#else
#define DEB(x)
#endif
#define MAXBOARDS 4 #define MAXBOARDS 4
static bool isapnp = 1; static bool isapnp = 1;
...@@ -195,7 +190,9 @@ static int makecode(unsigned hosterr, unsigned scsierr) ...@@ -195,7 +190,9 @@ static int makecode(unsigned hosterr, unsigned scsierr)
case 0x1a: /* Invalid CCB or Segment List Parameter-A segment list with a zero case 0x1a: /* Invalid CCB or Segment List Parameter-A segment list with a zero
length segment or invalid segment list boundaries was received. length segment or invalid segment list boundaries was received.
A CCB parameter was invalid. */ A CCB parameter was invalid. */
DEB(printk("Aha1542: %x %x\n", hosterr, scsierr)); #ifdef DEBUG
printk("Aha1542: %x %x\n", hosterr, scsierr);
#endif
hosterr = DID_ERROR; /* Couldn't find any better */ hosterr = DID_ERROR; /* Couldn't find any better */
break; break;
...@@ -340,11 +337,9 @@ static void aha1542_intr_handle(struct Scsi_Host *sh) ...@@ -340,11 +337,9 @@ static void aha1542_intr_handle(struct Scsi_Host *sh)
spin_unlock_irqrestore(&aha1542_lock, flags); spin_unlock_irqrestore(&aha1542_lock, flags);
#ifdef DEBUG #ifdef DEBUG
{ if (ccb[mbo].tarstat | ccb[mbo].hastat)
if (ccb[mbo].tarstat | ccb[mbo].hastat) shost_printk(KERN_DEBUG, sh, "aha1542_command: returning %x (status %d)\n",
shost_printk(KERN_DEBUG, sh, "aha1542_command: returning %x (status %d)\n", ccb[mbo].tarstat + ((int) ccb[mbo].hastat << 16), mb[mbi].status);
ccb[mbo].tarstat + ((int) ccb[mbo].hastat << 16), mb[mbi].status);
};
#endif #endif
if (mbistatus == 3) if (mbistatus == 3)
...@@ -386,26 +381,17 @@ static void aha1542_intr_handle(struct Scsi_Host *sh) ...@@ -386,26 +381,17 @@ static void aha1542_intr_handle(struct Scsi_Host *sh)
if (errstatus) if (errstatus)
shost_printk(KERN_DEBUG, sh, "(aha1542 error:%x %x %x) ", errstatus, shost_printk(KERN_DEBUG, sh, "(aha1542 error:%x %x %x) ", errstatus,
ccb[mbo].hastat, ccb[mbo].tarstat); ccb[mbo].hastat, ccb[mbo].tarstat);
#endif
if (ccb[mbo].tarstat == 2) { if (ccb[mbo].tarstat == 2) {
#ifdef DEBUG
int i; int i;
#endif
DEB(printk("aha1542_intr_handle: sense:")); printk("aha1542_intr_handle: sense:");
#ifdef DEBUG
for (i = 0; i < 12; i++) for (i = 0; i < 12; i++)
printk("%02x ", ccb[mbo].cdb[ccb[mbo].cdblen + i]); printk("%02x ", ccb[mbo].cdb[ccb[mbo].cdblen + i]);
printk("\n"); printk("\n");
#endif
/*
DEB(printk("aha1542_intr_handle: buf:"));
for (i = 0; i < bufflen; i++)
printk("%02x ", ((unchar *)buff)[i]);
printk("\n");
*/
} }
DEB(if (errstatus) printk("aha1542_intr_handle: returning %6x\n", errstatus)); if (errstatus)
printk("aha1542_intr_handle: returning %6x\n", errstatus);
#endif
tmp_cmd->result = errstatus; tmp_cmd->result = errstatus;
aha1542->int_cmds[mbo] = NULL; /* This effectively frees up the mailbox slot, as aha1542->int_cmds[mbo] = NULL; /* This effectively frees up the mailbox slot, as
far as queuecommand is concerned */ far as queuecommand is concerned */
...@@ -438,15 +424,15 @@ static int aha1542_queuecommand_lck(struct scsi_cmnd *cmd, void (*done) (struct ...@@ -438,15 +424,15 @@ static int aha1542_queuecommand_lck(struct scsi_cmnd *cmd, void (*done) (struct
int mbo; int mbo;
struct mailbox *mb = aha1542->mb; struct mailbox *mb = aha1542->mb;
struct ccb *ccb = aha1542->ccb; struct ccb *ccb = aha1542->ccb;
#ifdef DEBUG
int i;
DEB(int i); if (target > 1) {
cmd->result = DID_TIME_OUT << 16;
DEB(if (target > 1) { done(cmd);
cmd->result = DID_TIME_OUT << 16; return 0;
done(cmd); return 0; }
} #endif
);
if (*cmd->cmnd == REQUEST_SENSE) { if (*cmd->cmnd == REQUEST_SENSE) {
/* Don't do the command - we have the sense data already */ /* Don't do the command - we have the sense data already */
cmd->result = 0; cmd->result = 0;
...@@ -564,7 +550,9 @@ static int aha1542_queuecommand_lck(struct scsi_cmnd *cmd, void (*done) (struct ...@@ -564,7 +550,9 @@ static int aha1542_queuecommand_lck(struct scsi_cmnd *cmd, void (*done) (struct
#endif #endif
if (done) { if (done) {
DEB(printk("aha1542_queuecommand: now waiting for interrupt ")); #ifdef DEBUG
printk("aha1542_queuecommand: now waiting for interrupt ");
#endif
cmd->scsi_done = done; cmd->scsi_done = done;
mb[mbo].status = 1; mb[mbo].status = 1;
aha1542_outb(cmd->device->host->io_port, CMD_START_SCSI); aha1542_outb(cmd->device->host->io_port, CMD_START_SCSI);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment