]> git.ipfire.org Git - thirdparty/linux.git/commit
net: macb: simplify macb_dma_desc_get_size()
authorThéo Lebrun <theo.lebrun@bootlin.com>
Tue, 14 Oct 2025 15:25:07 +0000 (17:25 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 16 Oct 2025 23:59:25 +0000 (16:59 -0700)
commit94a164598d833aaee98a81b2910ac7bfea09e60f
treeaf7c1b175dbb8375965cd6a41e615b7e82f63c02
parentd7a4a20abe25bb5a15358c8d20a0ab12b7a52f79
net: macb: simplify macb_dma_desc_get_size()

macb_dma_desc_get_size() does a switch on bp->hw_dma_cap and covers all
four cases: 0, 64B, PTP, 64B+PTP. It also covers the #ifndef
MACB_EXT_DESC separately, making it four codepaths.

Instead, notice the descriptor size grows with enabled features and use
plain if-statements on 64B and PTP flags.

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Link: https://patch.msgid.link/20251014-macb-cleanup-v1-6-31cd266e22cd@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/cadence/macb_main.c