[PATCH 11/21] can: af_can: can_rx_register(): use max() instead of open coding it

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch replaces an open coded max by the proper kernel define max().

Acked-by: Oliver Hartkopp <soketcan@xxxxxxxxxxxx>
Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
---
 net/can/af_can.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/can/af_can.c b/net/can/af_can.c
index 36c7b4311936..28ea80274121 100644
--- a/net/can/af_can.c
+++ b/net/can/af_can.c
@@ -474,8 +474,8 @@ int can_rx_register(struct net *net, struct net_device *dev, canid_t can_id,
 		dev_rcv_lists->entries++;
 
 		rcv_lists_stats->rcv_entries++;
-		if (rcv_lists_stats->rcv_entries_max < rcv_lists_stats->rcv_entries)
-			rcv_lists_stats->rcv_entries_max = rcv_lists_stats->rcv_entries;
+		rcv_lists_stats->rcv_entries_max = max(rcv_lists_stats->rcv_entries_max,
+						       rcv_lists_stats->rcv_entries);
 	} else {
 		kmem_cache_free(rcv_cache, rcv);
 		err = -ENODEV;
-- 
2.23.0.rc1




[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux