summaryrefslogtreecommitdiffstats
path: root/sys/pci
diff options
context:
space:
mode:
authoranholt <anholt@FreeBSD.org>2004-08-21 06:18:11 +0000
committeranholt <anholt@FreeBSD.org>2004-08-21 06:18:11 +0000
commitbab63472f83a82fb9c3d660dca31ffc7034a09f2 (patch)
tree55be89c0c7c6d3fc1d9b25618fdebecafff3ad92 /sys/pci
parent84cd481c4b5568d5c7119fe96c918ce68e105b2f (diff)
downloadFreeBSD-src-bab63472f83a82fb9c3d660dca31ffc7034a09f2.zip
FreeBSD-src-bab63472f83a82fb9c3d660dca31ffc7034a09f2.tar.gz
Apply some stylistic changes based off of kern/70037 (content changes to
follow).
Diffstat (limited to 'sys/pci')
-rw-r--r--sys/pci/agp_ali.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sys/pci/agp_ali.c b/sys/pci/agp_ali.c
index cff5260..67debd5 100644
--- a/sys/pci/agp_ali.c
+++ b/sys/pci/agp_ali.c
@@ -98,6 +98,7 @@ agp_ali_attach(device_t dev)
struct agp_ali_softc *sc = device_get_softc(dev);
struct agp_gatt *gatt;
int error;
+ u_int32_t attbase;
error = agp_generic_attach(dev);
if (error)
@@ -126,10 +127,9 @@ agp_ali_attach(device_t dev)
sc->gatt = gatt;
/* Install the gatt. */
- pci_write_config(dev, AGP_ALI_ATTBASE,
- (gatt->ag_physical
- | (pci_read_config(dev, AGP_ALI_ATTBASE, 4) & 0xff)),
- 4);
+ attbase = pci_read_config(dev, AGP_ALI_ATTBASE, 4);
+ pci_write_config(dev, AGP_ALI_ATTBASE, gatt->ag_physical |
+ (attbase & 0xff), 4);
/* Enable the TLB. */
pci_write_config(dev, AGP_ALI_TLBCTRL, 0x10, 1);
@@ -142,6 +142,7 @@ agp_ali_detach(device_t dev)
{
struct agp_ali_softc *sc = device_get_softc(dev);
int error;
+ u_int32_t attbase;
error = agp_generic_detach(dev);
if (error)
@@ -152,9 +153,8 @@ agp_ali_detach(device_t dev)
/* Put the aperture back the way it started. */
AGP_SET_APERTURE(dev, sc->initial_aperture);
- pci_write_config(dev, AGP_ALI_ATTBASE,
- pci_read_config(dev, AGP_ALI_ATTBASE, 4) & 0xff,
- 4);
+ attbase = pci_read_config(dev, AGP_ALI_ATTBASE, 4);
+ pci_write_config(dev, AGP_ALI_ATTBASE, attbase & 0xff, 4);
agp_free_gatt(sc->gatt);
return 0;
@@ -194,6 +194,7 @@ static int
agp_ali_set_aperture(device_t dev, u_int32_t aperture)
{
int i;
+ u_int32_t attbase;
for (i = 0; i < agp_ali_table_size; i++)
if (agp_ali_table[i] == aperture)
@@ -201,9 +202,8 @@ agp_ali_set_aperture(device_t dev, u_int32_t aperture)
if (i == agp_ali_table_size)
return EINVAL;
- pci_write_config(dev, AGP_ALI_ATTBASE,
- ((pci_read_config(dev, AGP_ALI_ATTBASE, 4) & ~0xff)
- | i), 4);
+ attbase = pci_read_config(dev, AGP_ALI_ATTBASE, 4);
+ pci_write_config(dev, AGP_ALI_ATTBASE, (attbase & ~0xff) | i, 4);
return 0;
}
OpenPOWER on IntegriCloud