Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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. [[email protected]: coding-style cleanups] [[email protected]: s@&&\@&& \@] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Jason A. Donenfeld <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Cc: Kees Cook <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
- Loading branch information