Commit 92d4256
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>1 parent fca3dc8 commit 92d4256
1 file changed
Lines changed: 16 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
56 | 54 | | |
57 | 55 | | |
58 | 56 | | |
59 | 57 | | |
60 | | - | |
61 | | - | |
62 | 58 | | |
63 | 59 | | |
64 | 60 | | |
| |||
2470 | 2466 | | |
2471 | 2467 | | |
2472 | 2468 | | |
| 2469 | + | |
| 2470 | + | |
| 2471 | + | |
| 2472 | + | |
| 2473 | + | |
| 2474 | + | |
| 2475 | + | |
| 2476 | + | |
| 2477 | + | |
| 2478 | + | |
2473 | 2479 | | |
2474 | 2480 | | |
2475 | 2481 | | |
2476 | 2482 | | |
2477 | | - | |
2478 | 2483 | | |
2479 | 2484 | | |
2480 | 2485 | | |
| |||
2488 | 2493 | | |
2489 | 2494 | | |
2490 | 2495 | | |
2491 | | - | |
2492 | | - | |
| 2496 | + | |
| 2497 | + | |
2493 | 2498 | | |
2494 | 2499 | | |
2495 | 2500 | | |
2496 | 2501 | | |
2497 | | - | |
2498 | | - | |
| 2502 | + | |
| 2503 | + | |
2499 | 2504 | | |
2500 | 2505 | | |
2501 | 2506 | | |
| |||
2546 | 2551 | | |
2547 | 2552 | | |
2548 | 2553 | | |
2549 | | - | |
| 2554 | + | |
2550 | 2555 | | |
2551 | 2556 | | |
2552 | 2557 | | |
| |||
2564 | 2569 | | |
2565 | 2570 | | |
2566 | 2571 | | |
2567 | | - | |
| 2572 | + | |
2568 | 2573 | | |
2569 | 2574 | | |
2570 | 2575 | | |
| |||
0 commit comments