[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241023105757.GA9767@noisy.programming.kicks-ass.net>
Date: Wed, 23 Oct 2024 12:57:57 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Dan Williams <dan.j.williams@...el.com>
Cc: David Lechner <dlechner@...libre.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Jonathan Cameron <jic23@...nel.org>,
Nuno Sá <nuno.sa@...log.com>,
Michael Hennerich <michael.hennerich@...log.com>,
linux-kernel@...r.kernel.org, linux-iio@...r.kernel.org,
linux-cxl@...r.kernel.org, przemyslaw.kitszel@...el.com
Subject: Re: [PATCH 1/3] cleanup: add conditional guard helper
On Fri, Oct 18, 2024 at 12:29:27PM -0700, Dan Williams wrote:
> Peter Zijlstra wrote:
> > On Tue, Oct 01, 2024 at 05:30:18PM -0500, David Lechner wrote:
> > > Add a new if_not_cond_guard() macro to cleanup.h for handling
> > > conditional guards such as mutext_trylock().
> > >
> > > This is more ergonomic than scoped_cond_guard() for most use cases.
> > > Instead of hiding the error handling statement in the macro args, it
> > > works like a normal if statement and allow the error path to be indented
> > > while the normal code flow path is not indented. And it avoid unwanted
> > > side-effect from hidden for loop in scoped_cond_guard().
> > >
> > > Signed-off-by: David Lechner <dlechner@...libre.com>
> > > ---
> > > include/linux/cleanup.h | 11 +++++++++++
> > > 1 file changed, 11 insertions(+)
> > >
> [..]
> > I've queued these two patches:
> >
> > git://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git locking/core
> >
> > But lacking if_not_guard() users, the robot isn't really going to give
> > me much feedback there, I suppose...
>
> Looks good. If that branch is rebase-able it would be nice to add some
> credit tags to "cleanup: Add conditional guard helper":
>
> Co-developed-by: Fabio M. De Francesco <fabio.m.de.francesco@...ux.intel.com>
> Signed-off-by: Fabio M. De Francesco <fabio.m.de.francesco@...ux.intel.com>
>
> David and I talked about that here:
>
> http://lore.kernel.org/f4cc471a-b602-48d8-8323-15efcd602814@baylibre.com
>
> Also feel free to add:
>
> Reviewed-by: Dan Williams <dan.j.williams@...el.com>
I rebased because I had to magic in the v4 from Przemek, and I added the
above tags to the if_not_guard() thing.
I've also pushed out a locking/test branch that includes the iio
conversion for the robots.
Once I push to tip/locking/core (people will get robot mail) the commits
should be stable and can be used in other branches if so desired.
Powered by blists - more mailing lists