aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/bus.h
diff options
context:
space:
mode:
authorJustin Hibbits <jhibbits@FreeBSD.org>2016-03-03 05:07:35 +0000
committerJustin Hibbits <jhibbits@FreeBSD.org>2016-03-03 05:07:35 +0000
commit534ccd7bbfadde557eeffe986e5462455c8111ea (patch)
tree6694899d37c3d4102983706c5d1f442c638cbcb1 /sys/sys/bus.h
parent342af4d5efec74bb4bc11261fdd9991c53616f54 (diff)
downloadsrc-534ccd7bbfadde557eeffe986e5462455c8111ea.tar.gz
src-534ccd7bbfadde557eeffe986e5462455c8111ea.zip
Replace all resource occurrences of '0UL/~0UL' with '0/~0'.
Summary: The idea behind this is '~0ul' is well-defined, and casting to uintmax_t, on a 32-bit platform, will leave the upper 32 bits as 0. The maximum range of a resource is 0xFFF.... (all bits of the full type set). By dropping the 'ul' suffix, C type promotion rules apply, and the sign extension of ~0 on 32 bit platforms gets it to a type-independent 'unsigned max'. Reviewed By: cem Sponsored by: Alex Perez/Inertial Computing Differential Revision: https://reviews.freebsd.org/D5255
Notes
Notes: svn path=/head/; revision=296336
Diffstat (limited to 'sys/sys/bus.h')
-rw-r--r--sys/sys/bus.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/sys/bus.h b/sys/sys/bus.h
index 0e408446f3c6..5f0df65146b6 100644
--- a/sys/sys/bus.h
+++ b/sys/sys/bus.h
@@ -478,14 +478,14 @@ void bus_enumerate_hinted_children(device_t bus);
static __inline struct resource *
bus_alloc_resource_any(device_t dev, int type, int *rid, u_int flags)
{
- return (bus_alloc_resource(dev, type, rid, 0ul, ~0ul, 1, flags));
+ return (bus_alloc_resource(dev, type, rid, 0, ~0, 1, flags));
}
static __inline struct resource *
bus_alloc_resource_anywhere(device_t dev, int type, int *rid,
rman_res_t count, u_int flags)
{
- return (bus_alloc_resource(dev, type, rid, 0ul, ~0ul, count, flags));
+ return (bus_alloc_resource(dev, type, rid, 0, ~0, count, flags));
}
/*