diff mbox series

[net-next] net: lan743x: clean up a check in lan743x_netdev_open()

Message ID f2483839-687f-4f30-b5fa-20eac90c1885@stanley.mountain (mailing list archive)
State Deferred
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: lan743x: clean up a check in lan743x_netdev_open() | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 16 this patch: 16
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 16 this patch: 16
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 16 this patch: 16
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-09-14--15-00 (tests: 764)

Commit Message

Dan Carpenter Sept. 14, 2024, 9:59 a.m. UTC
The "adapter->netdev->phydev" and "netdev->phydev" pointers are different
names for the same thing.  Use them consistently.  It makes the code more
clear to humans and static checkers alike.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
I noticed a different static checker warning that I never reported because it
was too old.  However, I think it's a valid issue.
drivers/net/ethernet/microchip/lan743x_main.c:109 lan743x_pci_init() warn: missing error code 'ret'
I think we should set an error code on that path.  It disables the PCI device
and then we continue to do PCI stuff even though the device is disabled.

 drivers/net/ethernet/microchip/lan743x_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Horman Sept. 14, 2024, 3:46 p.m. UTC | #1
On Sat, Sep 14, 2024 at 12:59:01PM +0300, Dan Carpenter wrote:
> The "adapter->netdev->phydev" and "netdev->phydev" pointers are different
> names for the same thing.  Use them consistently.  It makes the code more
> clear to humans and static checkers alike.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Hi Dan,

net-next is currently closed, other than for bug fixes.
So please repost this once it re-opens, after v6.12-rc1 is released.

> ---
> I noticed a different static checker warning that I never reported because it
> was too old.  However, I think it's a valid issue.
> drivers/net/ethernet/microchip/lan743x_main.c:109 lan743x_pci_init() warn: missing error code 'ret'
> I think we should set an error code on that path.  It disables the PCI device
> and then we continue to do PCI stuff even though the device is disabled.

Yes, I agree.

I tend to think that is a bug. Though perhaps
there is no urgency in fixing it as it seems unlikely
to occur in practice and it seems to date back to when the
driver was added in 2018 / v4.17.

commit 23f0703c125b ("lan743x: Add main source files for new lan743x driver")

...
diff mbox series

Patch

diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c
index 4dc5adcda6a3..0b8c82ff5e8e 100644
--- a/drivers/net/ethernet/microchip/lan743x_main.c
+++ b/drivers/net/ethernet/microchip/lan743x_main.c
@@ -3262,7 +3262,7 @@  static int lan743x_netdev_open(struct net_device *netdev)
 		phy_support_eee(netdev->phydev);
 
 #ifdef CONFIG_PM
-	if (adapter->netdev->phydev) {
+	if (netdev->phydev) {
 		struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL };
 
 		phy_ethtool_get_wol(netdev->phydev, &wol);