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] [thread-next>] [day] [month] [year] [list]
Date: Fri, 26 May 2023 21:20:17 +0300
From: andy.shevchenko@...il.com
To: "Russell King (Oracle)" <rmk+kernel@...linux.org.uk>
Cc: Andrew Lunn <andrew@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>,
	Jiawen Wu <jiawenwu@...stnetic.com>,
	Maxime Chevallier <maxime.chevallier@...tlin.com>,
	Simon Horman <simon.horman@...igine.com>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next 1/6] net: mdio: add mdio_device_get() and
 mdio_device_put()

Fri, May 26, 2023 at 11:14:24AM +0100, Russell King (Oracle) kirjoitti:
> Add two new operations for a mdio device to manage the refcount on the
> underlying struct device. This will be used by mdio PCS drivers to
> simplify the creation and destruction handling, making it easier for
> users to get it correct.

...

> +static inline void mdio_device_get(struct mdio_device *mdiodev)
> +{
> +	get_device(&mdiodev->dev);

Dunno what is the practice in net, but it makes sense to have the pattern as

	if (mdiodev)
		return to_mdiodev(get_device(&mdiodev->dev));

which might be helpful in some cases. This approach is used in many cases in
the kernel.

> +}

P.S. Just my 2c, you may ignore the above comment.

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ