lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
 <SEYPR06MB5134FEDC81B12477031E2C179DA0A@SEYPR06MB5134.apcprd06.prod.outlook.com>
Date: Wed, 10 Dec 2025 02:51:11 +0000
From: Jacky Chou <jacky_chou@...eedtech.com>
To: Russell King <linux@...linux.org.uk>
CC: Andrew Lunn <andrew@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>,
	"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Joel
 Stanley <joel@....id.au>, Andrew Jeffery <andrew@...econstruct.com.au>, Potin
 Lai <potin.lai@...ntatw.com>, "netdev@...r.kernel.org"
	<netdev@...r.kernel.org>, "linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>, "linux-aspeed@...ts.ozlabs.org"
	<linux-aspeed@...ts.ozlabs.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>
Subject: [PATCH net v2] net: mdio: aspeed: add dummy read to avoid
 read-after-write issue

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ