[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251111153644.000065bd@huawei.com>
Date: Tue, 11 Nov 2025 15:36:44 +0000
From: Jonathan Cameron <jonathan.cameron@...wei.com>
To: Robert Richter <rrichter@....com>
CC: Alison Schofield <alison.schofield@...el.com>, Vishal Verma
<vishal.l.verma@...el.com>, Ira Weiny <ira.weiny@...el.com>, Dan Williams
<dan.j.williams@...el.com>, Dave Jiang <dave.jiang@...el.com>, "Davidlohr
Bueso" <dave@...olabs.net>, <linux-cxl@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, Gregory Price <gourry@...rry.net>, "Fabio M.
De Francesco" <fabio.m.de.francesco@...ux.intel.com>, Terry Bowman
<terry.bowman@....com>, Joshua Hahn <joshua.hahnjy@...il.com>
Subject: Re: [PATCH v4 14/14] cxl/region: Remove local variable @inc in
cxl_port_setup_targets()
On Mon, 3 Nov 2025 19:47:55 +0100
Robert Richter <rrichter@....com> wrote:
> Simplify the code by removing local variable @inc. The variable is not
> used elsewhere, remove it and directly increment the target number.
>
> Signed-off-by: Robert Richter <rrichter@....com>
Hmm. I wonder what the thought process behind this once was? Ah well
clearly not needed now and I can't be bothered to do the archeology /
have too much other stuff to review!
Reviewed-by: Jonathan Cameron <jonathan.cameron@...wei.com>
> ---
> drivers/cxl/core/region.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
> index dec003084521..a81fbe9cedae 100644
> --- a/drivers/cxl/core/region.c
> +++ b/drivers/cxl/core/region.c
> @@ -1332,7 +1332,7 @@ static int cxl_port_setup_targets(struct cxl_port *port,
> struct cxl_endpoint_decoder *cxled)
> {
> struct cxl_root_decoder *cxlrd = cxlr->cxlrd;
> - int parent_iw, parent_ig, ig, iw, rc, inc = 0, pos = cxled->pos;
> + int parent_iw, parent_ig, ig, iw, rc, pos = cxled->pos;
> struct cxl_port *parent_port = to_cxl_port(port->dev.parent);
> struct cxl_region_ref *cxl_rr = cxl_rr_load(port, cxlr);
> struct cxl_memdev *cxlmd = cxled_to_memdev(cxled);
> @@ -1524,9 +1524,8 @@ static int cxl_port_setup_targets(struct cxl_port *port,
> cxlsd->target[cxl_rr->nr_targets_set] = ep->dport;
> cxlsd->cxld.target_map[cxl_rr->nr_targets_set] = ep->dport->port_id;
> }
> - inc = 1;
> + cxl_rr->nr_targets_set++;
> out_target_set:
> - cxl_rr->nr_targets_set += inc;
> dev_dbg(&cxlr->dev, "%s:%s target[%d] = %s for %s:%s @ %d\n",
> dev_name(port->uport_dev), dev_name(&port->dev),
> cxl_rr->nr_targets_set - 1, dev_name(ep->dport->dport_dev),
Powered by blists - more mailing lists