Convert BAD_RANGE() to an inline function

Release: 2.5.19

Developer: William Irwin

Patched against: linux-2.5.19