]> Gentwo Git Trees - linux/.git/commit
net: macb: move ring size computation to functions
authorThéo Lebrun <theo.lebrun@bootlin.com>
Tue, 23 Sep 2025 16:00:25 +0000 (18:00 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 27 Sep 2025 00:54:50 +0000 (17:54 -0700)
commit92d4256fafd8d0a14d3aaa10452ac771bf9b597c
tree7f95a0598cb648de2d030ae925ec4e089247e138
parentfca3dc859b200ca4dcdd2124beaf3bb2ab80b0f7
net: macb: move ring size computation to functions

The tx/rx ring size calculation is somewhat complex and partially hidden
behind a macro. Move that out of the {RX,TX}_RING_BYTES() macros and
macb_{alloc,free}_consistent() functions into neat separate functions.

In macb_free_consistent(), we drop the size variable and directly call
the size helpers in the arguments list. In macb_alloc_consistent(), we
keep the size variable that is used by netdev_dbg() calls.

Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250923-macb-fixes-v6-3-772d655cdeb6@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/cadence/macb_main.c