From: Robert Richter <rrichter@amd.com>
To: Alison Schofield <alison.schofield@intel.com>,
Vishal Verma <vishal.l.verma@intel.com>,
Ira Weiny <ira.weiny@intel.com>,
Dan Williams <dan.j.williams@intel.com>,
Jonathan Cameron <jonathan.cameron@huawei.com>,
Dave Jiang <dave.jiang@intel.com>,
Davidlohr Bueso <dave@stgolabs.net>
Cc: <linux-cxl@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Gregory Price <gourry@gourry.net>,
"Fabio M. De Francesco" <fabio.m.de.francesco@linux.intel.com>,
Terry Bowman <terry.bowman@amd.com>,
Joshua Hahn <joshua.hahnjy@gmail.com>,
Robert Richter <rrichter@amd.com>
Subject: [PATCH 3/3] cxl/region: Remove local variable @inc in cxl_port_setup_targets()
Date: Wed, 12 Nov 2025 21:51:04 +0100 [thread overview]
Message-ID: <20251112205105.1271726-4-rrichter@amd.com> (raw)
In-Reply-To: <20251112205105.1271726-1-rrichter@amd.com>
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>
---
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 2b5ae5d9a4b6..e577b11bd889 100644
--- a/drivers/cxl/core/region.c
+++ b/drivers/cxl/core/region.c
@@ -1357,7 +1357,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);
@@ -1549,9 +1549,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),
--
2.47.3
next prev parent reply other threads:[~2025-11-12 20:51 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-12 20:51 [PATCH 0/3] CXL updates for v6.19 Robert Richter
2025-11-12 20:51 ` [PATCH 1/3] cxl: Simplify cxl_rd_ops allocation and handling Robert Richter
2025-11-12 22:35 ` Gregory Price
2025-11-12 20:51 ` [PATCH 2/3] cxl/acpi: Group xor arithmetric setup code in a single block Robert Richter
2025-11-12 22:36 ` Gregory Price
2025-11-12 22:38 ` Gregory Price
2025-11-12 20:51 ` Robert Richter [this message]
2025-11-12 22:40 ` [PATCH 3/3] cxl/region: Remove local variable @inc in cxl_port_setup_targets() Gregory Price
2025-11-12 21:45 ` [PATCH 0/3] CXL updates for v6.19 Dave Jiang
2025-11-13 11:01 ` Robert Richter
2025-11-13 15:20 ` Dave Jiang
2025-11-13 15:32 ` Gregory Price
2025-11-13 16:34 ` Dave Jiang
2025-11-13 16:45 ` Robert Richter
2025-11-13 20:10 ` Dave Jiang
2025-11-13 20:36 ` Robert Richter
2025-11-14 9:09 ` Robert Richter
2025-11-14 15:32 ` Dave Jiang
2025-11-14 16:21 ` Robert Richter
2025-11-14 16:28 ` Dave Jiang
2025-11-14 18:18 ` Dave Jiang
2025-11-14 18:25 ` Robert Richter
2025-11-14 18:35 ` Dave Jiang
2025-11-14 20:19 ` Dave Jiang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251112205105.1271726-4-rrichter@amd.com \
--to=rrichter@amd.com \
--cc=alison.schofield@intel.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=fabio.m.de.francesco@linux.intel.com \
--cc=gourry@gourry.net \
--cc=ira.weiny@intel.com \
--cc=jonathan.cameron@huawei.com \
--cc=joshua.hahnjy@gmail.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=terry.bowman@amd.com \
--cc=vishal.l.verma@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®