Re: [PATCH v2] ACPI: NFIT: Fix local use of devm_*()

2023-10-14 Thread Andy Shevchenko
On Sat, Oct 14, 2023 at 12:20 AM Dan Williams wrote: > Wilczynski, Michal wrote: ... > "The new cleanup.h facilities that arrived in v6.5-rc1 can replace the > the usage of devm semantics in acpi_nfit_init_interleave_set(). That > routine appears to only be using devm to avoid goto statements.

Re: [PATCH v2] ACPI: NFIT: Fix local use of devm_*()

2023-10-13 Thread Dan Williams
Wilczynski, Michal wrote: > > > On 10/13/2023 7:05 PM, Dan Williams wrote: > > Wilczynski, Michal wrote: > >> On 10/13/2023 6:38 PM, Dan Williams wrote: > >>> Michal Wilczynski wrote: > devm_*() family of functions purpose is managing memory attached to a > device. So in general it

Re: [PATCH v2] ACPI: NFIT: Fix local use of devm_*()

2023-10-13 Thread Wilczynski, Michal
On 10/13/2023 7:05 PM, Dan Williams wrote: > Wilczynski, Michal wrote: >> On 10/13/2023 6:38 PM, Dan Williams wrote: >>> Michal Wilczynski wrote: devm_*() family of functions purpose is managing memory attached to a device. So in general it should only be used for allocations that

Re: [PATCH v2] ACPI: NFIT: Fix local use of devm_*()

2023-10-13 Thread Dan Williams
Wilczynski, Michal wrote: > On 10/13/2023 6:38 PM, Dan Williams wrote: > > Michal Wilczynski wrote: > >> devm_*() family of functions purpose is managing memory attached to a > >> device. So in general it should only be used for allocations that should > >> last for the whole lifecycle of the

Re: [PATCH v2] ACPI: NFIT: Fix local use of devm_*()

2023-10-13 Thread Wilczynski, Michal
On 10/13/2023 6:38 PM, Dan Williams wrote: > Michal Wilczynski wrote: >> devm_*() family of functions purpose is managing memory attached to a >> device. So in general it should only be used for allocations that should >> last for the whole lifecycle of the device. > No, this assertion is not

Re: [PATCH v2] ACPI: NFIT: Fix local use of devm_*()

2023-10-13 Thread Dan Williams
Michal Wilczynski wrote: > devm_*() family of functions purpose is managing memory attached to a > device. So in general it should only be used for allocations that should > last for the whole lifecycle of the device. No, this assertion is not accurate, if it were strictly true then devm_kfree()

[PATCH v2] ACPI: NFIT: Fix local use of devm_*()

2023-10-13 Thread Michal Wilczynski
devm_*() family of functions purpose is managing memory attached to a device. So in general it should only be used for allocations that should last for the whole lifecycle of the device. This is not the case for acpi_nfit_init_interleave_set(). There are two allocations that are only used locally