diff options
author | jhibbits <jhibbits@FreeBSD.org> | 2016-02-20 01:32:58 +0000 |
---|---|---|
committer | jhibbits <jhibbits@FreeBSD.org> | 2016-02-20 01:32:58 +0000 |
commit | f8385663eeba2c10cd82a51c0a461a4f932458a3 (patch) | |
tree | 1d99680c416ab999716f7e3fb78956be8804e81f /sys/arm/at91 | |
parent | 7a33cbc5f75355b9aacc299db55706229c9da4af (diff) | |
download | FreeBSD-src-f8385663eeba2c10cd82a51c0a461a4f932458a3.zip FreeBSD-src-f8385663eeba2c10cd82a51c0a461a4f932458a3.tar.gz |
Introduce a RMAN_IS_DEFAULT_RANGE() macro, and use it.
This simplifies checking for default resource range for bus_alloc_resource(),
and improves readability.
This is part of, and related to, the migration of rman_res_t from u_long to
uintmax_t.
Discussed with: jhb
Suggested by: marcel
Diffstat (limited to 'sys/arm/at91')
-rw-r--r-- | sys/arm/at91/at91.c | 2 | ||||
-rw-r--r-- | sys/arm/at91/at91_pinctrl.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/arm/at91/at91.c b/sys/arm/at91/at91.c index 0b0d911..0947ec7 100644 --- a/sys/arm/at91/at91.c +++ b/sys/arm/at91/at91.c @@ -164,7 +164,7 @@ at91_alloc_resource(device_t dev, device_t child, int type, int *rid, return (NULL); if (rle->res) panic("Resource rid %d type %d already in use", *rid, type); - if (start == 0UL && end == ~0UL) { + if (RMAN_IS_DEFAULT_RANGE(start, end)) { start = rle->start; count = ulmax(count, rle->count); end = ulmax(rle->end, start + count - 1); diff --git a/sys/arm/at91/at91_pinctrl.c b/sys/arm/at91/at91_pinctrl.c index 7a90f0f..e5652d1 100644 --- a/sys/arm/at91/at91_pinctrl.c +++ b/sys/arm/at91/at91_pinctrl.c @@ -280,7 +280,7 @@ pinctrl_alloc_resource(device_t bus, device_t child, int type, int *rid, * Request for the default allocation with a given rid: use resource * list stored in the local device info. */ - if ((start == 0UL) && (end == ~0UL)) { + if (RMAN_IS_DEFAULT_RANGE(start, end)) { if ((di = device_get_ivars(child)) == NULL) return (NULL); |