]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: phy: improve mdiobus_stats_acct
authorHeiner Kallweit <hkallweit1@gmail.com>
Fri, 27 Feb 2026 22:11:02 +0000 (23:11 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 3 Mar 2026 12:23:45 +0000 (13:23 +0100)
- 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>
drivers/net/phy/mdio_bus.c

index 48c0447e6a8f7a3a642fef32f2a18c7ebde8cb85..b32a369cd25f50636463528b1e8aea7404faa8fa 100644 (file)
@@ -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();
 }
 
 /**