# Re: \[PATCH\] sfc: replace min/max nesting with clamp()

- From: Joe Damato \<hidden\>
- Date: 2025-08-12 18:06:32 
- List: netdev
- Page: https://ratatoskr.run/netdev/2025/08/3167078
- Thread: https://ratatoskr.run/netdev/2025/08/3165900/t.md

```text
On Tue, Aug 12, 2025 at 02:50:26PM +0800, Xichao Zhao wrote:
> 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 <redacted>
> ---
>  drivers/net/ethernet/sfc/efx_channels.c       | 4 ++--
>  drivers/net/ethernet/sfc/falcon/efx.c         | 5 ++---
>  drivers/net/ethernet/sfc/siena/efx_channels.c | 4 ++--
>  3 files changed, 6 insertions(+), 7 deletions(-)
>

Reviewed-by: Joe Damato <redacted>
```
