diff options
author | Matthew Wilcox <matthew@wil.cx> | 2007-10-05 15:55:09 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.localdomain> | 2007-10-23 15:12:36 -0400 |
commit | 4d85b471593d03e141f9160a58574b9204363267 (patch) | |
tree | 322457b73d4b5872ddb5c0651d8820933f0a68c4 /drivers/scsi/sym53c8xx_2/sym_hipd.c | |
parent | a44131b35ec1a46ed75014d818cb9d5706117b49 (diff) |
[SCSI] sym53c8xx: Simplify DAC DMA handling
By introducing the use_dac(), set_dac() and DMA_DAC_MASK macros, we can
eliminate a lot of ifdefs from the code. We now rely on the compiler to
optimise away a few things that we'd formerly relied on the preprocessor
to do. This makes sym_setup_bus_dma_mask() small enough to inline into
its only caller.
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/sym53c8xx_2/sym_hipd.c')
-rw-r--r-- | drivers/scsi/sym53c8xx_2/sym_hipd.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.c b/drivers/scsi/sym53c8xx_2/sym_hipd.c index 39f84bbe6856..5d0d356e1e74 100644 --- a/drivers/scsi/sym53c8xx_2/sym_hipd.c +++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c | |||
@@ -778,19 +778,12 @@ static int sym_prepare_setting(struct Scsi_Host *shost, struct sym_hcb *np, stru | |||
778 | * 64 bit addressing (895A/896/1010) ? | 778 | * 64 bit addressing (895A/896/1010) ? |
779 | */ | 779 | */ |
780 | if (np->features & FE_DAC) { | 780 | if (np->features & FE_DAC) { |
781 | #if SYM_CONF_DMA_ADDRESSING_MODE == 0 | 781 | if (!use_dac(np)) |
782 | np->rv_ccntl1 |= (DDAC); | 782 | np->rv_ccntl1 |= (DDAC); |
783 | #elif SYM_CONF_DMA_ADDRESSING_MODE == 1 | 783 | else if (SYM_CONF_DMA_ADDRESSING_MODE == 1) |
784 | if (!np->use_dac) | 784 | np->rv_ccntl1 |= (XTIMOD | EXTIBMV); |
785 | np->rv_ccntl1 |= (DDAC); | 785 | else if (SYM_CONF_DMA_ADDRESSING_MODE == 2) |
786 | else | 786 | np->rv_ccntl1 |= (0 | EXTIBMV); |
787 | np->rv_ccntl1 |= (XTIMOD | EXTIBMV); | ||
788 | #elif SYM_CONF_DMA_ADDRESSING_MODE == 2 | ||
789 | if (!np->use_dac) | ||
790 | np->rv_ccntl1 |= (DDAC); | ||
791 | else | ||
792 | np->rv_ccntl1 |= (0 | EXTIBMV); | ||
793 | #endif | ||
794 | } | 787 | } |
795 | 788 | ||
796 | /* | 789 | /* |
@@ -1322,7 +1315,7 @@ int sym_lookup_dmap(struct sym_hcb *np, u32 h, int s) | |||
1322 | { | 1315 | { |
1323 | int i; | 1316 | int i; |
1324 | 1317 | ||
1325 | if (!np->use_dac) | 1318 | if (!use_dac(np)) |
1326 | goto weird; | 1319 | goto weird; |
1327 | 1320 | ||
1328 | /* Look up existing mappings */ | 1321 | /* Look up existing mappings */ |
@@ -1837,7 +1830,7 @@ void sym_start_up (struct sym_hcb *np, int reason) | |||
1837 | * Set up scratch C and DRS IO registers to map the 32 bit | 1830 | * Set up scratch C and DRS IO registers to map the 32 bit |
1838 | * DMA address range our data structures are located in. | 1831 | * DMA address range our data structures are located in. |
1839 | */ | 1832 | */ |
1840 | if (np->use_dac) { | 1833 | if (use_dac(np)) { |
1841 | np->dmap_bah[0] = 0; /* ??? */ | 1834 | np->dmap_bah[0] = 0; /* ??? */ |
1842 | OUTL(np, nc_scrx[0], np->dmap_bah[0]); | 1835 | OUTL(np, nc_scrx[0], np->dmap_bah[0]); |
1843 | OUTL(np, nc_drs, np->dmap_bah[0]); | 1836 | OUTL(np, nc_drs, np->dmap_bah[0]); |