[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f4cc471a-b602-48d8-8323-15efcd602814@baylibre.com>
Date: Fri, 4 Oct 2024 15:27:14 -0500
From: David Lechner <dlechner@...libre.com>
To: Dan Williams <dan.j.williams@...el.com>,
Peter Zijlstra <peterz@...radead.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Jonathan Cameron <jic23@...nel.org>
Cc: 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, fabio.maria.de.francesco@...ux.intel.com
Subject: Re: [PATCH 1/3] cleanup: add conditional guard helper
On 10/4/24 12:34 PM, Dan Williams wrote:
> [ add Fabio ]
>
> 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>
>
> Hi David,
>
> When you update this to the if_not_guard() name can you also add Fabio as a
> co-developer? His work [1] contributed to eliciting the response from Linus,
> and then this patch takes the novel additional step to create an "if ()" macro.
>
> Thanks for pushing this forward!
>
> [1]: http://lore.kernel.org/20240130164059.25130-1-fabio.maria.de.francesco@linux.intel.com
Sure, I didn't dig deep enough to find that patch, but basically
the same idea. :-)
Powered by blists - more mailing lists