Re: [patch 02/10] genirq/msi: Use lock guards for MSI descriptor locking
From: Jonathan Cameron
Date: Wed Mar 12 2025 - 11:09:24 EST
On Tue, 11 Mar 2025 22:26:52 +0100
Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
> On Tue, Mar 11 2025 at 18:00, Jonathan Cameron wrote:
> > On Sun, 9 Mar 2025 09:41:44 +0100 (CET)
> > Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
>
> >>
> >> @@ -1037,25 +1032,23 @@ bool msi_create_device_irq_domain(struct
> >> if (msi_setup_device_data(dev))
> >
> > Hmm. We might want to make the docs in cleanup.h more nuanced.
> > They specifically say to not mix goto and auto cleanup, but
> > in the case of scoped_guard() unlikely almost any other case
> > it should be fine.
> >
> >> goto free_fwnode;
>
> I got rid of the gotos. It requires __free() for the two allocations.
That works.
>
> Thanks,
>
> tglx
> ---
> --- a/include/linux/cleanup.h
> +++ b/include/linux/cleanup.h
> @@ -216,6 +216,8 @@ const volatile void * __must_check_fn(co
>
> #define return_ptr(p) return no_free_ptr(p)
>
> +#define retain_ptr(p) \
> + __get_and_null(p, NULL)
Single line?
This sort of thing got discussed in the past though I doubt I can find
the thread. There was some push back but maybe now is it's time!
Probably worth shouting about it a bit to attract attention. Maybe
a separate patch.
Jonathan