]> git.ipfire.org Git - thirdparty/linux.git/commit
s390/mm: Simplify gap clamping in mmap_base() using clamp()
authorQasim Ijaz <qasdev00@gmail.com>
Tue, 4 Feb 2025 16:25:08 +0000 (16:25 +0000)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 4 Mar 2025 16:18:08 +0000 (17:18 +0100)
commita702b633c0649eef5249e0355ecfb60567e4dbf2
tree04181c54b709bf9bb38dd72691d75a1e65965257
parentad9bb8f049717d64c5e62b2a44954be9f681c65b
s390/mm: Simplify gap clamping in mmap_base() using clamp()

mmap_base() has logic to ensure that the variable "gap" stays within the
range defined by "gap_min" and "gap_max". Replace this with the clamp()
macro to shorten and simplify code.

Signed-off-by: Qasim Ijaz <qasdev00@gmail.com>
Link: https://lore.kernel.org/r/20250204162508.12335-1-qasdev00@gmail.com
Reviewed-by: Vasily Gorbik <gor@linux.ibm.com>
[gor@linux.ibm.com: also remove the gap_min and gap_max variables]
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/mm/mmap.c