]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: stmmac: clean up stmmac_reset()
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Tue, 11 Nov 2025 11:26:39 +0000 (11:26 +0000)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 13 Nov 2025 16:03:15 +0000 (17:03 +0100)
commitd0af55df5a786cb8f11ca1923cd7dc8b2af01309
tree12e24cf536ebb1760e399bcf873809e02e6bd025
parent9f07af1d274223a4314b5e2e6d395a78166c24c5
net: stmmac: clean up stmmac_reset()

stmmac_reset() takes the stmmac_priv and an ioaddr. It has one call
site, which passes the priv pointer, and dereferences priv for the
ioaddr.

stmmac_reset() then checks whether priv is NULL. If it was, the caller
would have oopsed. Remove the checks for NULL, and move the dereference
for ioaddr into stmmac_reset().

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1vImWF-0000000DrIr-1fmn@rmk-PC.armlinux.org.uk
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/stmicro/stmmac/hwif.c
drivers/net/ethernet/stmicro/stmmac/hwif.h
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c