From: Marc Kleine-Budde Date: Mon, 8 Oct 2018 07:02:36 +0000 (+0200) Subject: can: af_can: can_rx_register(): use max() instead of open coding it X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e2586a5796d6c6a812b401c7f1da2519ce3cf821;p=linux.git can: af_can: can_rx_register(): use max() instead of open coding it This patch replaces an open coded max by the proper kernel define max(). Acked-by: Oliver Hartkopp Signed-off-by: Oleksij Rempel Signed-off-by: Marc Kleine-Budde --- diff --git a/net/can/af_can.c b/net/can/af_can.c index 36c7b4311936c..28ea802741211 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;