From: Heiner Kallweit Date: Fri, 27 Feb 2026 22:11:02 +0000 (+0100) Subject: net: phy: improve mdiobus_stats_acct X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1afccc5a201ec7c9023370958bae1312369b64da;p=thirdparty%2Fkernel%2Flinux.git 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 Link: https://patch.msgid.link/2ceeb542-986a-404e-ad0f-62e0a938ce7c@gmail.com Signed-off-by: Paolo Abeni --- diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 48c0447e6a8f7..b32a369cd25f5 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(); } /**