Files
Anton Moryakov aca230f0f5 lib: remove redundant checks in get_u64 and get_s64
Static analyzer reported:
1. if (res > 0xFFFFFFFFFFFFFFFFULL)
Expression 'res > 0xFFFFFFFFFFFFFFFFULL' is always false , which may be caused by a logical error:
'res' has a type 'unsigned long long' with minimum value '0' and a maximum value '18446744073709551615'

2. if (res > INT64_MAX || res < INT64_MIN)
Expression 'res > INT64_MAX' is always false , which may be caused by a logical error: 'res' has a type 'long long'
with minimum value '-9223372036854775808' and a maximum value '9223372036854775807'
Expression 'res < INT64_MIN' is always false , which may be caused by a logical error: 'res' has a type 'long long'
with minimum value '-9223372036854775808' and a maximum value '9223372036854775807'

Corrections explained:
- Removed redundant check `res > 0xFFFFFFFFFFFFFFFFULL` in `get_u64`,
  as `res` cannot exceed this value due to its type.
- Removed redundant checks `res > INT64_MAX` and `res < INT64_MIN` in `get_s64`,
  as `res` cannot exceed the range of `long long`.

Triggers found by static analyzer Svace.

Signed-off-by: Anton Moryakov <ant.v.moryakov@gmail.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2025-02-19 15:47:42 +00:00
..
2022-01-15 10:41:13 -08:00
2022-07-25 12:07:16 -07:00
2024-01-27 13:59:49 -08:00
2024-12-12 15:22:22 -08:00
2024-01-22 20:26:08 -08:00
2016-03-27 10:50:14 -07:00
2023-06-05 12:49:34 -06:00
2024-01-25 16:49:10 -08:00
2023-06-23 16:46:29 -07:00
2023-06-05 12:49:34 -06:00
2024-11-16 04:37:39 +00:00
2023-06-05 18:45:45 -07:00
2023-06-05 18:45:45 -07:00
2022-07-29 11:22:42 -06:00