diff options
| author | Heiner Kallweit <hkallweit1@gmail.com> | 2026-02-27 23:11:02 +0100 |
|---|---|---|
| committer | Paolo Abeni <pabeni@redhat.com> | 2026-03-03 13:23:45 +0100 |
| commit | 1afccc5a201ec7c9023370958bae1312369b64da (patch) | |
| tree | 3b2ced4fe1bd36391c25ed8df3894c7eb79ddca8 /drivers/net/phy | |
| parent | 7f97ca5f9858629f618d7f3b5a16c0d6e48e4353 (diff) | |
| download | lwn-1afccc5a201ec7c9023370958bae1312369b64da.tar.gz lwn-1afccc5a201ec7c9023370958bae1312369b64da.zip | |
net: phy: improve mdiobus_stats_acct
- Remove duplicated preempt disable. Disabling preemption has been added
to functions like u64_stats_update_begin() in the meantime.
- Simplify branch structure
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://patch.msgid.link/2ceeb542-986a-404e-ad0f-62e0a938ce7c@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/net/phy')
| -rw-r--r-- | drivers/net/phy/mdio_bus.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 48c0447e6a8f..b32a369cd25f 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c @@ -358,22 +358,17 @@ EXPORT_SYMBOL(of_mdio_find_bus); static void mdiobus_stats_acct(struct mdio_bus_stats *stats, bool op, int ret) { - preempt_disable(); u64_stats_update_begin(&stats->syncp); u64_stats_inc(&stats->transfers); - if (ret < 0) { + if (ret < 0) u64_stats_inc(&stats->errors); - goto out; - } - - if (op) + else if (op) u64_stats_inc(&stats->reads); else u64_stats_inc(&stats->writes); -out: + u64_stats_update_end(&stats->syncp); - preempt_enable(); } /** |
