Zhen Lei ea258f159d get rid of INT_LIMIT, use type_max() instead
INT_LIMIT() tries to do what type_max() does, except that type_max()
doesn't rely upon undefined behaviour[*], might as well use type_max()
instead.

[*] if T is an N-bit signed integer type, the maximal value in T is
pow(2, N - 1) - 1, all right, but naive expression for that value
ends up with a couple of wraparounds and as usual for wraparounds
in signed types, that's an undefined behaviour.  type_max() takes
care to avoid those...

Caught-by: UBSAN
Suggested-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2022-11-25 15:43:39 -05:00
..
2022-10-05 10:38:24 -07:00
2022-10-07 17:04:10 -07:00
2022-10-07 16:48:26 -07:00
2022-09-27 10:15:24 -03:00
2022-10-07 12:33:18 -07:00
2022-10-10 20:28:41 -07:00
2022-10-07 12:33:18 -07:00