Commit 21351013 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by James Bottomley

[SCSI] a3000: Reindentation

Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent be4540db
......@@ -19,7 +19,8 @@
#include "wd33c93.h"
#include "a3000.h"
#include<linux/stat.h>
#include <linux/stat.h>
#define DMA(ptr) ((a3000_scsiregs *)((ptr)->base))
#define HDATA(ptr) ((struct WD33C93_hostdata *)((ptr)->hostdata))
......@@ -28,17 +29,16 @@ static struct Scsi_Host *a3000_host = NULL;
static int a3000_release(struct Scsi_Host *instance);
static irqreturn_t a3000_intr (int irq, void *dummy)
static irqreturn_t a3000_intr(int irq, void *dummy)
{
unsigned long flags;
unsigned int status = DMA(a3000_host)->ISTR;
if (!(status & ISTR_INT_P))
return IRQ_NONE;
if (status & ISTR_INTS)
{
if (status & ISTR_INTS) {
spin_lock_irqsave(a3000_host->host_lock, flags);
wd33c93_intr (a3000_host);
wd33c93_intr(a3000_host);
spin_unlock_irqrestore(a3000_host->host_lock, flags);
return IRQ_HANDLED;
}
......@@ -57,12 +57,11 @@ static int dma_setup(struct scsi_cmnd *cmd, int dir_in)
* end of a physical memory chunk, then allocate a bounce
* buffer
*/
if (addr & A3000_XFER_MASK)
{
HDATA(a3000_host)->dma_bounce_len = (cmd->SCp.this_residual + 511)
& ~0x1ff;
if (addr & A3000_XFER_MASK) {
HDATA(a3000_host)->dma_bounce_len =
(cmd->SCp.this_residual + 511) & ~0x1ff;
HDATA(a3000_host)->dma_bounce_buffer =
kmalloc (HDATA(a3000_host)->dma_bounce_len, GFP_KERNEL);
kmalloc(HDATA(a3000_host)->dma_bounce_len, GFP_KERNEL);
/* can't allocate memory; use PIO */
if (!HDATA(a3000_host)->dma_bounce_buffer) {
......@@ -72,7 +71,7 @@ static int dma_setup(struct scsi_cmnd *cmd, int dir_in)
if (!dir_in) {
/* copy to bounce buffer for a write */
memcpy (HDATA(a3000_host)->dma_bounce_buffer,
memcpy(HDATA(a3000_host)->dma_bounce_buffer,
cmd->SCp.ptr, cmd->SCp.this_residual);
}
......@@ -91,12 +90,13 @@ static int dma_setup(struct scsi_cmnd *cmd, int dir_in)
/* setup DMA *physical* address */
DMA(a3000_host)->ACR = addr;
if (dir_in)
if (dir_in) {
/* invalidate any cache */
cache_clear (addr, cmd->SCp.this_residual);
else
cache_clear(addr, cmd->SCp.this_residual);
} else {
/* push any dirty cache */
cache_push (addr, cmd->SCp.this_residual);
cache_push(addr, cmd->SCp.this_residual);
}
/* start DMA */
mb(); /* make sure setup is completed */
......@@ -146,14 +146,14 @@ static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt,
if (status && HDATA(instance)->dma_bounce_buffer) {
if (SCpnt) {
if (HDATA(instance)->dma_dir && SCpnt)
memcpy (SCpnt->SCp.ptr,
memcpy(SCpnt->SCp.ptr,
HDATA(instance)->dma_bounce_buffer,
SCpnt->SCp.this_residual);
kfree (HDATA(instance)->dma_bounce_buffer);
kfree(HDATA(instance)->dma_bounce_buffer);
HDATA(instance)->dma_bounce_buffer = NULL;
HDATA(instance)->dma_bounce_len = 0;
} else {
kfree (HDATA(instance)->dma_bounce_buffer);
kfree(HDATA(instance)->dma_bounce_buffer);
HDATA(instance)->dma_bounce_buffer = NULL;
HDATA(instance)->dma_bounce_len = 0;
}
......@@ -172,7 +172,7 @@ static int __init a3000_detect(struct scsi_host_template *tpnt)
tpnt->proc_name = "A3000";
tpnt->proc_info = &wd33c93_proc_info;
a3000_host = scsi_register (tpnt, sizeof(struct WD33C93_hostdata));
a3000_host = scsi_register(tpnt, sizeof(struct WD33C93_hostdata));
if (a3000_host == NULL)
goto fail_register;
......
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