diff options
author | 2022-09-26 15:34:34 +0200 | |
---|---|---|
committer | 2022-11-18 13:55:07 -0800 | |
commit | 5efcecd9a3b18078d3398b359a84c83f549e22cf (patch) | |
tree | 006d1fe563fa148ba64c2d72040dd0fe738d6d0f /include/linux/init.h | |
parent | ARM: kexec: make machine_crash_nonpanic_core() static (diff) | |
download | wireguard-linux-5efcecd9a3b18078d3398b359a84c83f549e22cf.tar.xz wireguard-linux-5efcecd9a3b18078d3398b359a84c83f549e22cf.zip |
minmax: sanity check constant bounds when clamping
The clamp family of functions only makes sense if hi>=lo. If hi and lo
are compile-time constants, then raise a build error. Doing so has
already caught buggy code. This also introduces the infrastructure to
improve the clamping function in subsequent commits.
[akpm@linux-foundation.org: coding-style cleanups]
[akpm@linux-foundation.org: s@&&\@&& \@]
Link: https://lkml.kernel.org/r/20220926133435.1333846-1-Jason@zx2c4.com
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/linux/init.h')
0 files changed, 0 insertions, 0 deletions