[PATCH net-next 7/8] net/rxrpc: Use min() to simplify the code
Hongbo Li
lihongbo22 at huawei.com
Sat Aug 24 00:40:32 PDT 2024
Let's use min() to simplify the code and fix the
Coccinelle/coccicheck warning reported by minmax.cocci.
Signed-off-by: Hongbo Li <lihongbo22 at huawei.com>
---
net/rxrpc/input.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c
index 16d49a861dbb..455aa0189b28 100644
--- a/net/rxrpc/input.c
+++ b/net/rxrpc/input.c
@@ -868,8 +868,7 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb)
prev_pkt = sp->ack.prev_ack;
nr_acks = sp->ack.nr_acks;
hard_ack = first_soft_ack - 1;
- summary.ack_reason = (sp->ack.reason < RXRPC_ACK__INVALID ?
- sp->ack.reason : RXRPC_ACK__INVALID);
+ summary.ack_reason = min(sp->ack.reason, RXRPC_ACK__INVALID);
trace_rxrpc_rx_ack(call, ack_serial, acked_serial,
first_soft_ack, prev_pkt,
--
2.34.1
More information about the linux-afs
mailing list