Re: [PATCH v2 4/5] platform/x86: int3472: Release ACPI objects using __free()

"Rafael J. Wysocki (Intel)" <[email protected]>
Newsgroups org.kernel.vger.linux-acpi,org.kernel.vger.linux-media,org.kernel.vger.platform-driver-x86
Message-ID <CAJZ5v0j66eOt4TP9JwHb-NOk6KunhanaYiQtwRSLPRRLcGRD-g@mail.gmail.com>
On Tue, Aug 25, 2026 at 2:04 PM Sakari Ailus
<[email protected]> wrote:
>
> Hi Rafael,
>
> Thank you for the review.
>
> On Tue, Aug 25, 2026 at 01:54:28PM +0200, Rafael J. Wysocki (Intel) wrote:
> > On Mon, Aug 24, 2026 at 11:13 PM Sakari Ailus
> > <[email protected]> wrote:
> > >
> > > Use __free() to release ACPI objects received from
> > > acpi_evaluate_dsm_typed() without explicit ACPI_FREE().
> >
> > Well, the benefit of doing so is not entirely clear to me.
> >
> > At least there is more overhead in the new code, or am I mistaken?
>
> It becomes possible to simplify error handling mid-function. See the 5th
> patch -- perhaps squashing this with that would make this more visible?

Possibly, but this may also be achieved by processing the object
coming from the ACPICA code in a separate function.  For example

obj = acpi_evaluate_dsm_typed(args);
ret = do_stuff_with_obj(obj);
ACPI_FREE(obj);
return ret;

and the error handling in do_stuff_with_obj() can be just like in the
case when __free() is used in the caller.

Of course, you may argue that acpi_evaluate_dsm_typed() can be used as
a proper constructor, so this is all fine, but IMV it is a special
case and I'm not quite comfortable with defining a _FREE that looks
general enough for this particular special case.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.