]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
sfc: replace min/max nesting with clamp()
authorXichao Zhao <zhao.xichao@vivo.com>
Tue, 12 Aug 2025 06:50:26 +0000 (14:50 +0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 15 Aug 2025 00:48:29 +0000 (17:48 -0700)
commit6398d8a856fb8be01f53cf84b481b3cdac978607
tree32febf26397e6e5ed46065ed8905323938e0cd15
parent6a18b85ca7d84486613d1857e49a656522bbe77c
sfc: replace min/max nesting with clamp()

The clamp() macro explicitly expresses the intent of constraining
a value within bounds.Therefore, replacing min(max(a, b), c) with
clamp(val, lo, hi) can improve code readability.

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
Reviewed-by: Joe Damato <joe@dama.to>
Reviewed-by: Edward Cree <ecree.xilinx@gmail.com>
Link: https://patch.msgid.link/20250812065026.620115-1-zhao.xichao@vivo.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/sfc/efx_channels.c
drivers/net/ethernet/sfc/falcon/efx.c
drivers/net/ethernet/sfc/siena/efx_channels.c