Skip to content

Cherry pick of minmax.h commits from 5.15.y

Eliav Farber linux-sparse lkml stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7tracing: Define the is_signed_type() macro onceinclude/linux/compiler.h include/linux/overflow.h include/linux/trace_events.h+6 -33 replies
2/7minmax: sanity check constant bounds when clampinginclude/linux/minmax.h+24 -20 replies
3/7minmax: clamp more efficiently by avoiding extra comparisoninclude/linux/minmax.h+1 -10 replies
4/7minmax: fix header inclusionsinclude/linux/minmax.h+2 -00 replies
5/7minmax: allow min()/max()/clamp() if the arguments have the same signedness.include/linux/minmax.h+32 -281 reply
6/7minmax: allow comparisons of 'int' against 'unsigned char/short'include/linux/minmax.h+3 -20 replies
7/7minmax: relax check to allow comparison between unsigned arguments and signed constantsinclude/linux/minmax.h+17 -70 replies

Reviews trailers per patch

3 of 7 patches have a Reviewed-by or Acked-by.

PatchKees CookAndy ShevchenkoHerve Codina
1/7A-b
2/7R-b
3/7
4/7R-b
5/7
6/7
7/7

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH 0/7 5.10.y] Cherry pick of minmax.h commits from 5.15.y

This series backports seven commits from v5.15.y that update minmax.h and related code:

- ed6e37e30826 ("tracing: Define the is_signed_type() macro once")
- 998f03984e25 ("minmax: sanity check constant bounds when clamping")
- d470787b25e6 ("minmax: clamp more efficiently by avoiding extra comparison")
- 1c2ee5bc9f11 ("minmax: fix header inclusions")
- d53b5d862acd ("minmax: allow min()/max()/clamp() if the arguments have the same signedness.")
- 7ed91c5560df ("minmax: allow comparisons of 'int' against 'unsigned char/short'")
- 22f7794ef5a3 ("minmax: relax check to allow comparison between unsigned arguments and signed constants")

The main motivation is commit d53b5d862acd, which removes the strict type check in min()/max() when both arguments have the same signedness. Without this, kernel 5.10 builds can emit warnings that become build failures when -Werror is used.

Additionally, commit ed6e37e30826 from tracing is required as a dependency; without it, compilation fails.

Andy Shevchenko (1):
minmax: fix header inclusions

Bart Van Assche (1):
tracing: Define the is_signed_type() macro once

David Laight (3):
minmax: allow min()/max()/clamp() if the arguments have the same
signedness.
minmax: allow comparisons of 'int' against 'unsigned char/short'
minmax: relax check to allow comparison between unsigned arguments and
signed constants

Jason A. Donenfeld (2):
minmax: sanity check constant bounds when clamping
minmax: clamp more efficiently by avoiding extra comparison

 include/linux/compiler.h     |  6 +++
 include/linux/minmax.h       | 89 ++++++++++++++++++++++++++----------
 include/linux/overflow.h     |  1 -
 include/linux/trace_events.h |  2 -
 4 files changed, 70 insertions(+), 28 deletions(-)
Signature · 1 line
2.47.3