diff options
author | mdodd <mdodd@FreeBSD.org> | 2000-10-18 00:09:26 +0000 |
---|---|---|
committer | mdodd <mdodd@FreeBSD.org> | 2000-10-18 00:09:26 +0000 |
commit | 24266e7d45309efd1c81c7333b14496258e6b81b (patch) | |
tree | d18a2adbe56101a453d116149ba7e431e628dc4a /sys/dev | |
parent | 81e1a4e6535529c973204e2f279d1f16fea83879 (diff) | |
download | FreeBSD-src-24266e7d45309efd1c81c7333b14496258e6b81b.zip FreeBSD-src-24266e7d45309efd1c81c7333b14496258e6b81b.tar.gz |
Use appropriate resource management accessors instead of directly
referencing structure members.
Use rman_get_size() instead of end - start + 1.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/agp/agp.c | 3 | ||||
-rw-r--r-- | sys/dev/pcic/i82365.c | 4 | ||||
-rw-r--r-- | sys/dev/pcic/i82365_isa.c | 2 | ||||
-rw-r--r-- | sys/dev/pdq/if_fea.c | 2 |
4 files changed, 5 insertions, 6 deletions
diff --git a/sys/dev/agp/agp.c b/sys/dev/agp/agp.c index 5bf48a1..2ba8727 100644 --- a/sys/dev/agp/agp.c +++ b/sys/dev/agp/agp.c @@ -746,8 +746,7 @@ agp_get_info(device_t dev, struct agp_info *info) info->ai_mode = pci_read_config(dev, agp_find_caps(dev) + AGP_STATUS, 4); info->ai_aperture_base = rman_get_start(sc->as_aperture); - info->ai_aperture_size = (rman_get_end(sc->as_aperture) - - rman_get_start(sc->as_aperture)) + 1; + info->ai_aperture_size = rmang_get_size(sc->as_aperture); info->ai_memory_allowed = sc->as_maxmem; info->ai_memory_used = sc->as_allocated; } diff --git a/sys/dev/pcic/i82365.c b/sys/dev/pcic/i82365.c index 1abdd7b..59df77a 100644 --- a/sys/dev/pcic/i82365.c +++ b/sys/dev/pcic/i82365.c @@ -1307,7 +1307,7 @@ pcic_activate_resource(device_t dev, device_t child, int type, int rid, bus_addr_t off; struct pcic_handle *h = pcic_get_handle(dev, child); - sz = rman_get_end(r) - rman_get_start(r) + 1; + sz = rman_get_size(r); switch (type) { case SYS_RES_IOPORT: win = rid; @@ -1416,7 +1416,7 @@ pcic_alloc_resource(device_t dev, device_t child, int type, int *rid, count, flags); if (r == NULL) return r; - sz = rman_get_end(r) - rman_get_start(r) + 1; + sz = rman_get_size(r); switch (type) { case SYS_RES_IOPORT: err = pcic_chip_io_alloc(h, rman_get_start(r), sz, 0, diff --git a/sys/dev/pcic/i82365_isa.c b/sys/dev/pcic/i82365_isa.c index 800b848..e71b87f 100644 --- a/sys/dev/pcic/i82365_isa.c +++ b/sys/dev/pcic/i82365_isa.c @@ -134,7 +134,7 @@ pcic_isa_bus_width_probe (device_t dev) struct resource *r; base = rman_get_start(sc->port_res); - length = rman_get_end(sc->port_res) - rman_get_end(sc->port_res) + 1; + length = rman_get_size(sc->port_res); iot = sc->iot; ioh = sc->ioh; diff --git a/sys/dev/pdq/if_fea.c b/sys/dev/pdq/if_fea.c index dc90631..229fd38 100644 --- a/sys/dev/pdq/if_fea.c +++ b/sys/dev/pdq/if_fea.c @@ -204,7 +204,7 @@ pdq_eisa_attach (dev) } m_addr = rman_get_start(mspace); - m_size = (rman_get_end(mspace) - rman_get_start(mspace)) + 1; + m_size = rman_get_size(mspace); sc->sc_iobase = (pdq_bus_ioport_t) rman_get_start(io); sc->sc_membase = (pdq_bus_memaddr_t) pmap_mapdev(m_addr, m_size); |