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]
Message-ID: <ac7c6c84-02e6-4e3d-8c38-abd5339a021d@lunn.ch>
Date: Tue, 16 Sep 2025 16:38:10 +0200
From: Andrew Lunn <andrew@...n.ch>
To: "Russell King (Oracle)" <linux@...linux.org.uk>
Cc: Wei Fang <wei.fang@....com>, Ajay Kaher <ajay.kaher@...adcom.com>,
	Alexey Makhalov <alexey.makhalov@...adcom.com>,
	Andrew Lunn <andrew+netdev@...n.ch>,
	Richard Cochran <richardcochran@...il.com>,
	Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>,
	Clark Wang <xiaoning.wang@....com>,
	"David S. Miller" <davem@...emloft.net>,
	David Woodhouse <dwmw2@...radead.org>,
	Eric Dumazet <edumazet@...gle.com>,
	"imx@...ts.linux.dev" <imx@...ts.linux.dev>,
	Jakub Kicinski <kuba@...nel.org>,
	Jonathan Lemon <jonathan.lemon@...il.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	Nick Shi <nick.shi@...adcom.com>, Paolo Abeni <pabeni@...hat.com>,
	Sven Schnelle <svens@...ux.ibm.com>,
	Vadim Fedorenko <vadim.fedorenko@...ux.dev>,
	Vladimir Oltean <vladimir.oltean@....com>,
	"Y.B. Lu" <yangbo.lu@....com>
Subject: Re: [PATCH net-next 2/2] ptp: rework ptp_clock_unregister() to
 disable events

On Tue, Sep 16, 2025 at 02:38:23PM +0100, Russell King (Oracle) wrote:
> On Tue, Sep 16, 2025 at 09:03:17AM +0000, Wei Fang wrote:
> > > the ordering of ptp_clock_unregister() is not ideal, as the chardev
> >  ^
> > Nit: Uppercase, 't' -> 'T'
> > 
> > > +void ptp_disable_all_pins(struct ptp_clock *ptp)
> > > +{
> > > +	struct ptp_clock_info *info = ptp->info;
> > > +	unsigned int i;
> > > +
> > > +	mutex_lock(&ptp->pincfg_mux);
> > 
> > Currently ptp_chardev.c has been converted to use the auto-cleanup
> > API (scoped_cond_guard()), so scoped_guard() can be used here.
> 
> ... which are very non-C like, non-obvious, and I currently have no
> idea at the moment how to use it. In my opinion, it makes code more
> difficult to understand.

+1

Plain scoped_guard() is not too magical and reasonably
understandable. But ptp_chardev.c is using scoped_conf_guard() which
is much more magical and i have no idea what it does.

> Maybe someone else can convert this for me to this non-C like
> structure?

Yes, if you want to write plain simple code, I submit it so. Somebody
else can follow up with an obfuscation patch.

     Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ