mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 10:33:41 +02:00
net: phy: avoid extra casting in mdio_bus_get_stat
Using void * instead of char * allows to remove one cast. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Link: https://patch.msgid.link/054bbf60-d8ac-45ce-8b80-9c396469b7f9@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
8068acaff1
commit
c599649d05
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user