projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8068aca
)
net: phy: avoid extra casting in mdio_bus_get_stat
author
Heiner Kallweit
<hkallweit1@gmail.com>
Fri, 27 Feb 2026 22:07:56 +0000
(23:07 +0100)
committer
Paolo Abeni
<pabeni@redhat.com>
Tue, 3 Mar 2026 12:23:45 +0000
(13:23 +0100)
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>
drivers/net/phy/mdio_bus.c
patch
|
blob
|
history
diff --git
a/drivers/net/phy/mdio_bus.c
b/drivers/net/phy/mdio_bus.c
index
f189e9f
..
fb2bcc6
100644
(file)
--- a/
drivers/net/phy/mdio_bus.c
+++ b/
drivers/net/phy/mdio_bus.c
@@
-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;