Commit 1afccc5a authored by Heiner Kallweit's avatar Heiner Kallweit Committed by Paolo Abeni
Browse files

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: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Link: https://patch.msgid.link/2ceeb542-986a-404e-ad0f-62e0a938ce7c@gmail.com


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 7f97ca5f
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -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();
}

/**