lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aRY7UhpGpvOeWhAF@rric.localdomain>
Date: Thu, 13 Nov 2025 21:10:58 +0100
From: Robert Richter <rrichter@....com>
To: Jonathan Cameron <jonathan.cameron@...wei.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 11.11.25 15:36:44, Jonathan Cameron wrote:
> 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!

The inc was there from the beginning (27b3f8d13830c). Maybe code
changed in the area during review process and left this as a
remainder from something else.

Thanks,

-Robert

> 
> 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

Powered by Openwall GNU/*/Linux Powered by OpenVZ