From: Jonathan Cameron via <qemu-devel@nongnu.org>
To: Arpit Kumar <arpit1.kumar@samsung.com>
Cc: <qemu-devel@nongnu.org>, <gost.dev@samsung.com>,
<linux-cxl@vger.kernel.org>, <nifan.cxl@gmail.com>,
<dave@stgolabs.net>, <vishak.g@samsung.com>,
<krish.reddy@samsung.com>, <a.manzanares@samsung.com>,
<alok.rathore@samsung.com>
Subject: Re: [PATCH 1/3] hw/cxl/cxl-mailbox-utils.c: Added support for Get Log Capabilities (Opcode 0402h)
Date: Wed, 12 Feb 2025 17:15:04 +0000 [thread overview]
Message-ID: <20250212171504.000051b7@huawei.com> (raw)
In-Reply-To: <20250212113012.datt6a7sddkbli25@test-PowerEdge-R740xd>
> >>
> >> +static const struct CXLLogCapabilities cxl_get_log_cap[MAX_LOG_TYPE] = {
> >> + [CEL] = {.param_flags.pflags = CXL_LOG_CAP_CLEAR | CXL_LOG_CAP_POPULATE,
> >> + .uuid = cel_uuid},
> >> +};
> >> +
> >> +static void cxl_init_get_log(CXLCCI *cci)
> >> +{
> >> + for (int set = CEL; set < MAX_LOG_TYPE; set++) {
> >> + cci->supported_log_cap[set] = cxl_get_log_cap[set];
> >
> >As below. Can we just use a static const pointer in cci?
>
> static const pointer in cci gives compilation error as it used below
> to assign value:
> cci->supported_log_cap[set] = cxl_get_log_cap[set];
True. That is what I am suggesting changing.
cci->supported_log_cap = cxl_get_log_cap;
This is currently iterating over a list and copying everything. Why
bother, just set a pointer to the source list. If there
are choices for that, pick between them but keep all those lists const.
>
> >> +typedef struct CXLLogCapabilities {
> >> + CXLParamFlags param_flags;
> >> + QemuUUID uuid;
> >> +} CXLLogCapabilities;
> >> +
> >> typedef struct CXLCCI {
> >> struct cxl_cmd cxl_cmd_set[256][256];
> >> struct cel_log {
> >> @@ -202,6 +230,9 @@ typedef struct CXLCCI {
> >> } cel_log[1 << 16];
> >> size_t cel_size;
> >>
> >> + /* get log capabilities */
> >> + CXLLogCapabilities supported_log_cap[MAX_LOG_TYPE];
> >Perhaps a const pointer is appropriate?
>
> const pointer here gives compilation error as it is used below
> to assign value:
> cci->supported_log_cap[set] = cxl_get_log_cap[set];
As above. This set is the thing I'm suggesting changing.
One general review process thing is it is much more productive
to just crop anything you agree with and just have the discussion
focused on questions etc that are outstanding.
Jonathan
next prev parent reply other threads:[~2025-02-12 17:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20250203060050epcas5p38f556047edbdedd98b6ac2d1d496a3dc@epcas5p3.samsung.com>
2025-02-03 5:59 ` [PATCH 0/3] CXL CCI Log Commands implementation Arpit Kumar
[not found] ` <CGME20250203060051epcas5p350b7b24d3b5fcff25bc30e1acccd8121@epcas5p3.samsung.com>
2025-02-03 5:59 ` [PATCH 1/3] hw/cxl/cxl-mailbox-utils.c: Added support for Get Log Capabilities (Opcode 0402h) Arpit Kumar
2025-02-04 10:28 ` Jonathan Cameron via
2025-02-12 11:30 ` Arpit Kumar
2025-02-12 17:15 ` Jonathan Cameron via [this message]
[not found] ` <CGME20250203060053epcas5p137fe4cbd5661afdfd2602dbc7facdcb9@epcas5p1.samsung.com>
2025-02-03 5:59 ` [PATCH 2/3] hw/cxl/cxl-mailbox-utils.c: Added support for Clear Log (Opcode 0403h) Arpit Kumar
2025-02-04 10:53 ` Jonathan Cameron via
2025-02-12 11:37 ` Arpit Kumar
[not found] ` <CGME20250203060055epcas5p4a7889ddf3b73b10f8b9b41778375ce63@epcas5p4.samsung.com>
2025-02-03 5:59 ` [PATCH 3/3] hw/cxl/cxl-mailbox-utils.c: Added support for Populate Log (Opcode 0404h) as background operation Arpit Kumar
2025-02-04 10:58 ` Jonathan Cameron via
2025-02-12 11:45 ` Arpit Kumar
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=20250212171504.000051b7@huawei.com \
--to=qemu-devel@nongnu.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=a.manzanares@samsung.com \
--cc=alok.rathore@samsung.com \
--cc=arpit1.kumar@samsung.com \
--cc=dave@stgolabs.net \
--cc=gost.dev@samsung.com \
--cc=krish.reddy@samsung.com \
--cc=linux-cxl@vger.kernel.org \
--cc=nifan.cxl@gmail.com \
--cc=vishak.g@samsung.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;
as well as URLs for NNTP newsgroup(s).