]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: stmmac: improve ndev->max_mtu setup readability
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Tue, 11 Nov 2025 11:26:34 +0000 (11:26 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 12 Nov 2025 17:17:20 +0000 (09:17 -0800)
commit7e975caa0f7bf2f83a5e18b4ae69c3d7fff4eafa
treeadd563fe1888c8b8a16181d193c2850ffb949ea1
parent1479493c91fc14b8387db01c0442cd1508c325e6
net: stmmac: improve ndev->max_mtu setup readability

Improve the readibility of the code setting ndev->max_mtu. This depends
on the hardware specific maximum defined by the MAC core, and also a
platform provided maximum.

The code was originally checking that the platform specific maximum was
between ndev->min_mtu..MAC core maximum before reducing ndev->max_mtu,
otherwise if the platform specific maximum was less than ndev->min_mtu,
issuing a warning.

Re-order the code to handle the case where the platform specific max is
below ndev->min_mtu, which then means that the subsequent test is
simply reducing ndev->max_mtu.

Update the comment, and add a few blank lines to separate the blocks of
code.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1vImWA-0000000DrIl-1HZY@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c