sys: util: Replace MIN(MAX(a, b), c) with CLAMP
Replaces all existing variants of value clamping with the MIN and MAX macros with the CLAMP macro. Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
This commit is contained in:
parent
ed1f75da74
commit
86c793af3f
16 changed files with 19 additions and 19 deletions
|
@ -1654,7 +1654,7 @@ static int offload_connect(struct net_context *context,
|
|||
* AT@SOCKCONN timeout param has minimum value of 30 seconds and
|
||||
* maximum value of 360 seconds, otherwise an error is generated
|
||||
*/
|
||||
timeout_sec = MIN(360, MAX(timeout_sec, 30));
|
||||
timeout_sec = CLAMP(timeout_sec, 30, 360);
|
||||
|
||||
snprintk(buf, sizeof(buf), "AT@SOCKCONN=%d,\"%s\",%d,%d",
|
||||
sock->socket_id, wncm14a2a_sprint_ip_addr(addr),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue