]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Replace all resource occurrences of '0UL/~0UL' with '0/~0'.
authorjhibbits <jhibbits@FreeBSD.org>
Thu, 3 Mar 2016 05:07:35 +0000 (05:07 +0000)
committerjhibbits <jhibbits@FreeBSD.org>
Thu, 3 Mar 2016 05:07:35 +0000 (05:07 +0000)
commit70aaabfeaca395af01baa82155ef9870825d9364
tree6694899d37c3d4102983706c5d1f442c638cbcb1
parentd74d168b0f125a4b155175b6593dc09109d035d5
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
12 files changed:
sys/dev/bhnd/bhnd.h
sys/dev/pccard/pccard.c
sys/dev/pci/pci.c
sys/dev/pci/pci_iov.c
sys/dev/pci/pci_pci.c
sys/dev/pci/vga_pci.c
sys/isa/isa_common.c
sys/kern/bus_if.m
sys/kern/subr_bus.c
sys/kern/subr_rman.c
sys/sys/bus.h
sys/x86/xen/xenpv.c