From: Vladimir Oltean Date: Sat, 13 Feb 2021 22:37:53 +0000 (+0200) Subject: net: mscc: ocelot: use DIV_ROUND_UP helper in ocelot_port_inject_frame X-Git-Tag: v5.15~1802^2~49^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5f016f42d342b25625de51dbd14af814c35ad70e;p=platform%2Fkernel%2Flinux-starfive.git net: mscc: ocelot: use DIV_ROUND_UP helper in ocelot_port_inject_frame This looks a bit nicer than the open-coded "(x + 3) % 4" idiom. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/mscc/ocelot_net.c b/drivers/net/ethernet/mscc/ocelot_net.c index b5ffe67..1ab4532 100644 --- a/drivers/net/ethernet/mscc/ocelot_net.c +++ b/drivers/net/ethernet/mscc/ocelot_net.c @@ -563,7 +563,7 @@ static int ocelot_port_xmit(struct sk_buff *skb, struct net_device *dev) ocelot_write_rix(ocelot, (__force u32)cpu_to_be32(ifh[i]), QS_INJ_WR, grp); - count = (skb->len + 3) / 4; + count = DIV_ROUND_UP(skb->len, 4); last = skb->len % 4; for (i = 0; i < count; i++) ocelot_write_rix(ocelot, ((u32 *)skb->data)[i], QS_INJ_WR, grp);