On Mon, Jul 07, 2025 at 08:11:55PM +0000, Michael Margolin wrote: > Following a discussion on changes in RDMA subsystem [1], there is a use > for helpers that allow overflow safe comparison between the result of a > sum or a diff between two variables and some third operand. The classic > use case is checking that end address is in range, given start address > and length, but there are probably others. Add helpers that perform > mathematically correct comparison regardles of the types being used. > > [1] https://lore.kernel.org/all/[email protected]/ > > Signed-off-by: Michael Margolin <[email protected]> > --- > include/linux/overflow.h | 34 ++++++++ > lib/tests/overflow_kunit.c | 171 +++++++++++++++++++++++++++++++++++++ > 2 files changed, 205 insertions(+)
You should make this a series and add at least one user.. Jason
