[PATCH net v2] net: mdio: aspeed: add dummy read to avoid read-after-write issue
Jacky Chou
jacky_chou at aspeedtech.com
Tue Dec 9 18:51:11 PST 2025
Hi Russell King,
> > + (void)ioread32(ctx->base + ASPEED_MDIO_CTRL);
>
> What purpose does this cast to void achieve in an already void context?
>
> We have plenty of functions that get called in the kernel that return a value
> which the caller ignores, never assigning to a variable, none of these warn.
>
Thanks for pointing this out.
On some older compilers I used to encounter warnings when ignoring a
function's return value, so adding (void) became a habitual practice.
You're right that it is unnecessary in the kernel context today.
I'll remove it in the next revision.
Thanks,
Jacky
More information about the linux-arm-kernel
mailing list