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

net: phy: avoid extra casting in mdio_bus_get_stat



Using void * instead of char * allows to remove one cast.

Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Link: https://patch.msgid.link/054bbf60-d8ac-45ce-8b80-9c396469b7f9@gmail.com


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 8068acaf
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -136,13 +136,13 @@ static struct mdio_bus_stat_attr *to_sattr(struct device_attribute *attr)

static u64 mdio_bus_get_stat(struct mdio_bus_stats *s, unsigned int offset)
{
	const char *p = (const char *)s + offset;
	const u64_stats_t *stats = (const void *)s + offset;
	unsigned int start;
	u64 val = 0;

	do {
		start = u64_stats_fetch_begin(&s->syncp);
		val = u64_stats_read((const u64_stats_t *)p);
		val = u64_stats_read(stats);
	} while (u64_stats_fetch_retry(&s->syncp, start));

	return val;