[PATCH net-next 09/13] net: fec: fec_enet_rx_queue(): use same signature as fec_enet_tx_queue()

Marc Kleine-Budde posted 13 patches 1 month, 1 week ago
[PATCH net-next 09/13] net: fec: fec_enet_rx_queue(): use same signature as fec_enet_tx_queue()
Posted by Marc Kleine-Budde 1 month, 1 week ago
There are the functions fec_enet_rx_queue() and fec_enet_tx_queue(),
one for handling the RX queue the other one handles the TX queue.

However they don't have the same signature. To make the code more
readable make the signature of fec_enet_rx_queue() identical to the
signature of fec_enet_tx_queue().

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/ethernet/freescale/fec_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index c8b2170735e599cd10492169ab32d0e20b28311b..eb26e869c026225194f4df66db145494408bfe8a 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1678,7 +1678,7 @@ fec_enet_run_xdp(struct fec_enet_private *fep, struct bpf_prog *prog,
  * effectively tossing the packet.
  */
 static int
-fec_enet_rx_queue(struct net_device *ndev, int budget, u16 queue_id)
+fec_enet_rx_queue(struct net_device *ndev, u16 queue_id, int budget)
 {
 	struct fec_enet_private *fep = netdev_priv(ndev);
 	struct fec_enet_priv_rx_q *rxq;
@@ -1899,7 +1899,7 @@ static int fec_enet_rx(struct net_device *ndev, int budget)
 
 	/* Make sure that AVB queues are processed first. */
 	for (i = fep->num_rx_queues - 1; i >= 0; i--)
-		done += fec_enet_rx_queue(ndev, budget - done, i);
+		done += fec_enet_rx_queue(ndev, i, budget - done);
 
 	return done;
 }

-- 
2.45.2
Re: [PATCH net-next 09/13] net: fec: fec_enet_rx_queue(): use same signature as fec_enet_tx_queue()
Posted by Frank Li 1 month, 1 week ago
On Wed, Oct 16, 2024 at 11:51:57PM +0200, Marc Kleine-Budde wrote:
> There are the functions fec_enet_rx_queue() and fec_enet_tx_queue(),
> one for handling the RX queue the other one handles the TX queue.
>
> However they don't have the same signature. To make the code more
> readable make the signature of fec_enet_rx_queue() identical to the
> signature of fec_enet_tx_queue().

'signature' is strange here.

Align fec_enet_rx_queue() argument order with fec_enet_tx_queue() to make
code more readable.

Frank

>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> ---
>  drivers/net/ethernet/freescale/fec_main.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
> index c8b2170735e599cd10492169ab32d0e20b28311b..eb26e869c026225194f4df66db145494408bfe8a 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -1678,7 +1678,7 @@ fec_enet_run_xdp(struct fec_enet_private *fep, struct bpf_prog *prog,
>   * effectively tossing the packet.
>   */
>  static int
> -fec_enet_rx_queue(struct net_device *ndev, int budget, u16 queue_id)
> +fec_enet_rx_queue(struct net_device *ndev, u16 queue_id, int budget)
>  {
>  	struct fec_enet_private *fep = netdev_priv(ndev);
>  	struct fec_enet_priv_rx_q *rxq;
> @@ -1899,7 +1899,7 @@ static int fec_enet_rx(struct net_device *ndev, int budget)
>
>  	/* Make sure that AVB queues are processed first. */
>  	for (i = fep->num_rx_queues - 1; i >= 0; i--)
> -		done += fec_enet_rx_queue(ndev, budget - done, i);
> +		done += fec_enet_rx_queue(ndev, i, budget - done);
>
>  	return done;
>  }
>
> --
> 2.45.2
>
>
Re: [PATCH net-next 09/13] net: fec: fec_enet_rx_queue(): use same signature as fec_enet_tx_queue()
Posted by Marc Kleine-Budde 1 month, 1 week ago
On 16.10.2024 22:32:20, Frank Li wrote:
> On Wed, Oct 16, 2024 at 11:51:57PM +0200, Marc Kleine-Budde wrote:
> > There are the functions fec_enet_rx_queue() and fec_enet_tx_queue(),
> > one for handling the RX queue the other one handles the TX queue.
> >
> > However they don't have the same signature. To make the code more
> > readable make the signature of fec_enet_rx_queue() identical to the
> > signature of fec_enet_tx_queue().
> 
> 'signature' is strange here.

Signature, or the full name 'type signature', defines the types and
order of a function's arguments, see:

| https://en.wikipedia.org/wiki/Type_signature

> Align fec_enet_rx_queue() argument order with fec_enet_tx_queue() to make
> code more readable.

I've updated the last sentence.

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |