From patchwork Sat Feb 13 22:37:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 382639 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79879C43381 for ; Sat, 13 Feb 2021 22:39:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5380264E69 for ; Sat, 13 Feb 2021 22:39:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229787AbhBMWjU (ORCPT ); Sat, 13 Feb 2021 17:39:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229744AbhBMWjE (ORCPT ); Sat, 13 Feb 2021 17:39:04 -0500 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1282DC061788 for ; Sat, 13 Feb 2021 14:38:24 -0800 (PST) Received: by mail-ej1-x62f.google.com with SMTP id jj19so5428321ejc.4 for ; Sat, 13 Feb 2021 14:38:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TKIbHpceU1DnPC7QTpKX8KQCC6z684N0eyQ2c4Qn/H4=; b=FM2uHeAGMdClLVAgk264CxbEmpExgOYDdqkxi8c8vujJc7lQQtlnNse+Y9TGeMFgEa CsPq8rL0PjqQ/ddZZxugxiRQh82CpOJprH1VTScXZMTBF5crRoSjnbz8Y9TsqE3p6tdh PZeAQaWBVKOsxD/ia3daMjbU7iVcQrd86UP22ywQhjklTsKAYJUgbdCujfv5VHSXZlDb bv/xZONNWN+lHxrzp/v1I3eY+OeK+SA3AJrnGR96jveD/EOPqiCZUevpyYczg2p8mUu4 wiBoy6kYRlet5kz6Va0KxFD0VqD2UI3FJO560VLU5uQxUnfs39RY0k4b9UYRC7vgXTOC mNMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TKIbHpceU1DnPC7QTpKX8KQCC6z684N0eyQ2c4Qn/H4=; b=XuVn94p37z453BP6fW1KOEvKwku4ixOFKNdHklgtQXBP5dkMRghyQyCNlDqSc/WmXD XqwaVBBPSi5gblPtH3fyqz/m4o2lB7R63xC58GBupSwgmOHQzpy6MMYUg9f/qvar56dd 5W2pdwTNTHakpsJ7P2XQN/fo4AA24VhqLE1cpVheyN6hXWpqhcaRKEGqdyLN1SdXLVqh Jb302eLhvE/CqhIaY0Y/MBor/5MfhZ/ChHp1WRmfaRcPhtfrr4eaxSYMwvhH3A07dUoK YC1gM5jDIW/8mHHQBY1b4UIeuPDgI0OxSkG8ph6/9HSBsSZens3z8JUKllRmlwj8lWGs WiFA== X-Gm-Message-State: AOAM5330Hx6l9A0qkQi3wnC0uOeviQ1yRcIoluEwpgQqFta0CqITnEay JLiKDKB3guA91EHpHcHCaZU= X-Google-Smtp-Source: ABdhPJwbX1veDeGICNubjHDV/RrPIgX1l3v5mrf++2CW7ivjVTdfrnph/1ztf+I+hbiqePwibuVBVg== X-Received: by 2002:a17:906:2743:: with SMTP id a3mr9236504ejd.378.1613255902777; Sat, 13 Feb 2021 14:38:22 -0800 (PST) Received: from localhost.localdomain (5-12-227-87.residential.rdsnet.ro. [5.12.227.87]) by smtp.gmail.com with ESMTPSA id h3sm7662582edw.18.2021.02.13.14.38.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Feb 2021 14:38:22 -0800 (PST) From: Vladimir Oltean To: "David S . Miller" , Jakub Kicinski , netdev@vger.kernel.org Cc: Andrew Lunn , Florian Fainelli , Vivien Didelot , Richard Cochran , Claudiu Manoil , Alexandre Belloni , Vladimir Oltean , Maxim Kochetkov , UNGLinuxDriver@microchip.com Subject: [PATCH v2 net-next 04/12] net: mscc: ocelot: use DIV_ROUND_UP helper in ocelot_port_inject_frame Date: Sun, 14 Feb 2021 00:37:53 +0200 Message-Id: <20210213223801.1334216-5-olteanv@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210213223801.1334216-1-olteanv@gmail.com> References: <20210213223801.1334216-1-olteanv@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Vladimir Oltean This looks a bit nicer than the open-coded "(x + 3) % 4" idiom. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli --- Changes in v2: None. drivers/net/ethernet/mscc/ocelot_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mscc/ocelot_net.c b/drivers/net/ethernet/mscc/ocelot_net.c index b5ffe6724eb7..1ab453298a18 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);