From: Marc Kleine-Budde mkl@pengutronix.de
mainline inclusion from mainline-v5.4-rc1 commit e2586a5796d6c6a812b401c7f1da2519ce3cf821 category: feature bugzilla: 38684 CVE: NA
---------------------------
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 Signed-off-by: Zhang Changzhong zhangchangzhong@huawei.com Reviewed-by: YueHaibing yuehaibing@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- 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 e1ec048ca9ec..87447a1d099d 100644 --- a/net/can/af_can.c +++ b/net/can/af_can.c @@ -500,8 +500,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;