mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 11:06:41 -05:00
cxl/region: Remove local variable @inc in cxl_port_setup_targets()
Simplify the code by removing local variable @inc. The variable is not used elsewhere, remove it and directly increment the target number. Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Signed-off-by: Robert Richter <rrichter@amd.com> Link: https://patch.msgid.link/20251114075844.1315805-4-rrichter@amd.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>
This commit is contained in:
committed by
Dave Jiang
parent
c42a4d2ee3
commit
7e71fa6e01
@@ -1328,7 +1328,7 @@ static int cxl_port_setup_targets(struct cxl_port *port,
|
||||
struct cxl_endpoint_decoder *cxled)
|
||||
{
|
||||
struct cxl_root_decoder *cxlrd = to_cxl_root_decoder(cxlr->dev.parent);
|
||||
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);
|
||||
@@ -1520,9 +1520,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),
|
||||
|
||||
Reference in New Issue
Block a user