netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, linux-can@vger.kernel.org,
	kernel@pengutronix.de, Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH net-next 2/9] can: m_can: remove a copy of the NAPI_POLL_WEIGHT define
Date: Mon,  2 May 2022 09:59:07 +0200	[thread overview]
Message-ID: <20220502075914.1905039-3-mkl@pengutronix.de> (raw)
In-Reply-To: <20220502075914.1905039-1-mkl@pengutronix.de>

From: Jakub Kicinski <kuba@kernel.org>

Defining local versions of NAPI_POLL_WEIGHT with the same values in
the drivers just makes refactoring harder.

Link: https://lore.kernel.org/all/20220429174446.196655-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/m_can/m_can.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
index 2779bba390f2..e6d2da4a9f41 100644
--- a/drivers/net/can/m_can/m_can.c
+++ b/drivers/net/can/m_can/m_can.c
@@ -77,9 +77,6 @@ enum m_can_reg {
 	M_CAN_TXEFA	= 0xf8,
 };
 
-/* napi related */
-#define M_CAN_NAPI_WEIGHT	64
-
 /* message ram configuration data length */
 #define MRAM_CFG_LEN	8
 
@@ -951,7 +948,7 @@ static int m_can_rx_peripheral(struct net_device *dev)
 	struct m_can_classdev *cdev = netdev_priv(dev);
 	int work_done;
 
-	work_done = m_can_rx_handler(dev, M_CAN_NAPI_WEIGHT);
+	work_done = m_can_rx_handler(dev, NAPI_POLL_WEIGHT);
 
 	/* Don't re-enable interrupts if the driver had a fatal error
 	 * (e.g., FIFO read failure).
@@ -1474,7 +1471,7 @@ static int m_can_dev_setup(struct m_can_classdev *cdev)
 
 	if (!cdev->is_peripheral)
 		netif_napi_add(dev, &cdev->napi,
-			       m_can_poll, M_CAN_NAPI_WEIGHT);
+			       m_can_poll, NAPI_POLL_WEIGHT);
 
 	/* Shared properties of all M_CAN versions */
 	cdev->version = m_can_version;
@@ -1994,7 +1991,7 @@ int m_can_class_register(struct m_can_classdev *cdev)
 
 	if (cdev->is_peripheral) {
 		ret = can_rx_offload_add_manual(cdev->net, &cdev->offload,
-						M_CAN_NAPI_WEIGHT);
+						NAPI_POLL_WEIGHT);
 		if (ret)
 			goto clk_disable;
 	}
-- 
2.35.1



  parent reply	other threads:[~2022-05-02  7:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-02  7:59 [PATCH net-next 0/9] pull-request: can-next 2022-05-02 Marc Kleine-Budde
2022-05-02  7:59 ` [PATCH net-next 1/9] dt-bindings: can: renesas,rcar-canfd: Document RZ/G2UL support Marc Kleine-Budde
2022-05-02 11:20   ` patchwork-bot+netdevbpf
2022-05-02  7:59 ` Marc Kleine-Budde [this message]
2022-05-02  7:59 ` [PATCH net-next 3/9] docs: networking: device drivers: can: add ctucanfd to index Marc Kleine-Budde
2022-05-02  7:59 ` [PATCH net-next 4/9] docs: networking: device drivers: can: ctucanfd: update author e-mail Marc Kleine-Budde
2022-05-02  7:59 ` [PATCH net-next 5/9] can: ctucanfd: remove unused including <linux/version.h> Marc Kleine-Budde
2022-05-02  7:59 ` [PATCH net-next 6/9] can: ctucanfd: ctucan_platform_probe(): remove unnecessary print function dev_err() Marc Kleine-Budde
2022-05-02  7:59 ` [PATCH net-next 7/9] can: ctucanfd: remove inline keyword from local static functions Marc Kleine-Budde
2022-05-02  7:59 ` [PATCH net-next 8/9] can: ctucanfd: remove debug statements Marc Kleine-Budde
2022-05-02  7:59 ` [PATCH net-next 9/9] can: ctucanfd: remove PCI module debug parameters Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220502075914.1905039-3-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=davem@davemloft.net \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).