[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <685adc4d1487b_1608bd1009b@dwillia2-xfh.jf.intel.com.notmuch>
Date: Tue, 24 Jun 2025 10:11:41 -0700
From: Dan Williams <dan.j.williams@...el.com>
To: Pranav Tyagi <pranav.tyagi03@...il.com>, <dave@...olabs.net>,
<jonathan.cameron@...wei.com>, <dave.jiang@...el.com>,
<alison.schofield@...el.com>, <vishal.l.verma@...el.com>,
<ira.weiny@...el.com>, <dan.j.williams@...el.com>
CC: <ming.li@...omail.com>, <rrichter@....com>,
<jeff.johnson@....qualcomm.com>, <peterz@...radead.org>,
<linux-cxl@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<skhan@...uxfoundation.org>, <linux-kernel-mentees@...ts.linux.dev>, "Pranav
Tyagi" <pranav.tyagi03@...il.com>
Subject: Re: [PATCH] cxl/port: automate cleanup with __free()
Pranav Tyagi wrote:
> Use the scope based resource management (defined in linux/cleanup.h) to
> automate the lifetime control of struct cxl_endpoint_decoder. This
> eliminates the explicit kfree() call and makes the code more robust and
> maintainable in presence of early returns.
I do not want to review small standalone conversions of individual
functions for no other reason than vague claims of improvement. The
reasons to convert an existing function to cleanup.h helpers are:
1/ to fix an actual bug
2/ in the course of refactoring the code for other reasons
3/ to eliminate goto trickiness and bulk
This patch does not make the code "more robust and maintainable", it is
just churn given how easy it is to verify that the kfree() is correctly
paired.
One quick way to identify code churn is when the diffstat does not
result in a net reduction in code lines:
This patch is "3 insertions(+), 3 deletions(-)" == "churn".
Powered by blists - more mailing lists