summaryrefslogtreecommitdiffstats
path: root/net/can
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2018-10-08 09:02:36 +0200
committerMarc Kleine-Budde <mkl@pengutronix.de>2019-09-04 13:29:14 +0200
commite2586a5796d6c6a812b401c7f1da2519ce3cf821 (patch)
treeee33d6a17ccf633937b3d15a3836b712763da8a1 /net/can
parent6625a18e9ff6462ff81f740a331899b69ad6033e (diff)
downloadlinux-e2586a5796d6c6a812b401c7f1da2519ce3cf821.tar.bz2
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 <socketcan@hartkopp.net> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'net/can')
-rw-r--r--net/can/af_can.c4
1 files 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;