]> www.infradead.org Git - users/willy/pagecache.git/commit
minmax: Add in_range() macro
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 10 Jul 2023 15:41:22 +0000 (11:41 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 1 Aug 2023 19:13:33 +0000 (15:13 -0400)
commitbf869947f58c382486e6a92143ae20f447833911
tree9e634d1da9805ccfdfed78c0dfdc2ebc943ba659
parentec89391563792edd11d138a853901bce76d11f44
minmax: Add in_range() macro

Determine if a value lies within a range more efficiently (subtraction +
comparison vs two comparisons and an AND).  It also has useful (under
some circumstances) behaviour if the range exceeds the maximum value of
the type.  Convert all the conflicting definitions of in_range() within
the kernel; some can use the generic definition while others need their
own definition.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
16 files changed:
arch/arm/mm/pageattr.c
drivers/gpu/drm/arm/display/include/malidp_utils.h
drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c
drivers/gpu/drm/msm/adreno/a6xx_gmu.c
drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
drivers/virt/acrn/ioreq.c
fs/btrfs/misc.h
fs/ext2/balloc.c
fs/ext4/ext4.h
fs/ufs/util.h
include/linux/minmax.h
lib/logic_pio.c
net/netfilter/nf_nat_core.c
net/tipc/core.h
net/tipc/link.c
tools/testing/selftests/bpf/progs/get_branch_snapshot.c