[SCSI] gvp11: Reindentation

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
This commit is contained in:
Geert Uytterhoeven 2010-04-04 11:00:33 +02:00 committed by James Bottomley
parent 09bc85b08c
commit bb17b7871b
2 changed files with 304 additions and 300 deletions

View File

@ -21,6 +21,7 @@
#include <linux/stat.h>
#define DMA(ptr) ((gvp11_scsiregs *)((ptr)->base))
#define HDATA(ptr) ((struct WD33C93_hostdata *)((ptr)->hostdata))
@ -55,15 +56,16 @@ static int dma_setup(struct scsi_cmnd *cmd, int dir_in)
static int scsi_alloc_out_of_range = 0;
/* use bounce buffer if the physical address is bad */
if (addr & HDATA(cmd->device->host)->dma_xfer_mask)
{
HDATA(cmd->device->host)->dma_bounce_len = (cmd->SCp.this_residual + 511)
& ~0x1ff;
if (addr & HDATA(cmd->device->host)->dma_xfer_mask) {
HDATA(cmd->device->host)->dma_bounce_len =
(cmd->SCp.this_residual + 511) & ~0x1ff;
if (!scsi_alloc_out_of_range) {
HDATA(cmd->device->host)->dma_bounce_buffer =
kmalloc (HDATA(cmd->device->host)->dma_bounce_len, GFP_KERNEL);
HDATA(cmd->device->host)->dma_buffer_pool = BUF_SCSI_ALLOCED;
kmalloc(HDATA(cmd->device->host)->dma_bounce_len,
GFP_KERNEL);
HDATA(cmd->device->host)->dma_buffer_pool =
BUF_SCSI_ALLOCED;
}
if (scsi_alloc_out_of_range ||
@ -72,13 +74,13 @@ static int dma_setup(struct scsi_cmnd *cmd, int dir_in)
amiga_chip_alloc(HDATA(cmd->device->host)->dma_bounce_len,
"GVP II SCSI Bounce Buffer");
if(!HDATA(cmd->device->host)->dma_bounce_buffer)
{
if (!HDATA(cmd->device->host)->dma_bounce_buffer) {
HDATA(cmd->device->host)->dma_bounce_len = 0;
return 1;
}
HDATA(cmd->device->host)->dma_buffer_pool = BUF_CHIP_ALLOCED;
HDATA(cmd->device->host)->dma_buffer_pool =
BUF_CHIP_ALLOCED;
}
/* check if the address of the bounce buffer is OK */
@ -86,7 +88,8 @@ static int dma_setup(struct scsi_cmnd *cmd, int dir_in)
if (addr & HDATA(cmd->device->host)->dma_xfer_mask) {
/* fall back to Chip RAM if address out of range */
if( HDATA(cmd->device->host)->dma_buffer_pool == BUF_SCSI_ALLOCED) {
if (HDATA(cmd->device->host)->dma_buffer_pool ==
BUF_SCSI_ALLOCED) {
kfree(HDATA(cmd->device->host)->dma_bounce_buffer);
scsi_alloc_out_of_range = 1;
} else {
@ -97,14 +100,14 @@ static int dma_setup(struct scsi_cmnd *cmd, int dir_in)
amiga_chip_alloc(HDATA(cmd->device->host)->dma_bounce_len,
"GVP II SCSI Bounce Buffer");
if(!HDATA(cmd->device->host)->dma_bounce_buffer)
{
if (!HDATA(cmd->device->host)->dma_bounce_buffer) {
HDATA(cmd->device->host)->dma_bounce_len = 0;
return 1;
}
addr = virt_to_bus(HDATA(cmd->device->host)->dma_bounce_buffer);
HDATA(cmd->device->host)->dma_buffer_pool = BUF_CHIP_ALLOCED;
HDATA(cmd->device->host)->dma_buffer_pool =
BUF_CHIP_ALLOCED;
}
if (!dir_in) {
@ -124,12 +127,13 @@ static int dma_setup(struct scsi_cmnd *cmd, int dir_in)
/* setup DMA *physical* address */
DMA(cmd->device->host)->ACR = addr;
if (dir_in)
if (dir_in) {
/* invalidate any cache */
cache_clear(addr, cmd->SCp.this_residual);
else
} else {
/* push any dirty cache */
cache_push(addr, cmd->SCp.this_residual);
}
if ((bank_mask = (~HDATA(cmd->device->host)->dma_xfer_mask >> 18) & 0x01c0))
DMA(cmd->device->host)->BANK = bank_mask & (addr >> 18);
@ -257,8 +261,8 @@ int __init gvp11_detect(struct scsi_host_template *tpnt)
if (*scmd_3393 != q) /* and so should the image at 0x1f */
goto release;
/* Ok, we probably have a wd33c93, but let's check a few other places
/*
* Ok, we probably have a wd33c93, but let's check a few other places
* for good measure. Make sure that this works for both 'A and 'B
* chip versions.
*/
@ -307,11 +311,11 @@ int __init gvp11_detect(struct scsi_host_template *tpnt)
else
HDATA(instance)->dma_xfer_mask = default_dma_xfer_mask;
DMA(instance)->secret2 = 1;
DMA(instance)->secret1 = 0;
DMA(instance)->secret3 = 15;
while (DMA(instance)->CNTR & GVP11_DMAC_BUSY) ;
while (DMA(instance)->CNTR & GVP11_DMAC_BUSY)
;
DMA(instance)->CNTR = 0;
DMA(instance)->BANK = 0;
@ -330,8 +334,8 @@ int __init gvp11_detect(struct scsi_host_template *tpnt)
(epc & GVP_SCSICLKMASK) ? WD33C93_FS_8_10
: WD33C93_FS_12_15);
if (request_irq(IRQ_AMIGA_PORTS, gvp11_intr, IRQF_SHARED, "GVP11 SCSI",
instance))
if (request_irq(IRQ_AMIGA_PORTS, gvp11_intr, IRQF_SHARED,
"GVP11 SCSI", instance))
goto unregister;
DMA(instance)->CNTR = GVP11_DMAC_INT_ENABLE;
num_gvp11++;