[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ab4f2017-9e40-4923-8f6e-6514a511dd4c@amd.com>
Date: Tue, 25 Mar 2025 10:46:05 -0500
From: Ben Cheatham <benjamin.cheatham@....com>
To: Alejandro Lucero Palau <alucerop@....com>,
<alejandro.lucero-palau@....com>
CC: Jonathan Cameron <Jonathan.Cameron@...wei.com>,
<linux-cxl@...r.kernel.org>, <netdev@...r.kernel.org>,
<dan.j.williams@...el.com>, <edward.cree@....com>, <davem@...emloft.net>,
<kuba@...nel.org>, <pabeni@...hat.com>, <edumazet@...gle.com>,
<dave.jiang@...el.com>
Subject: Re: [PATCH v11 11/23] cxl: define a driver interface for HPA free
space enumeration
>>> +
>>> + for (int i = 0; i < ctx->interleave_ways; i++)
>>> + for (int j = 0; j < ctx->interleave_ways; j++)
>>> + if (ctx->host_bridges[i] == cxlsd->target[j]->dport_dev) {
>>> + found++;
>>> + break;
>>> + }
>> I think kernel coding style requires braces on the above for statements, but I may be wrong here.
>
>
> I can not see a specific reference to this case. But, do you mean both for clauses requiring it or just the second one?
>
I think it should be:
for (int i = 0; i < ctx->interleave_ways; i++) {
for (int j = 0 ; j < ctx->interleave_ways; j++) {
...
}
}
But it's a style nit, if whoever is taking the patch doesn't care then I don't really either.
>
[snip]
>>> +
>>> +/**
>>> + * cxl_get_hpa_freespace - find a root decoder with free capacity per constraints
>>> + * @cxlmd: the CXL memory device with an endpoint that is mapped by the returned
>>> + * decoder
>>> + * @interleave_ways: number of entries in @host_bridges
>>> + * @flags: CXL_DECODER_F flags for selecting RAM vs PMEM, and HDM-H vs HDM-D[B]
>> Looking below, the HDM-H vs HDM-D[B] flag is called CXL_DECODER_F_TYPE2, so I think
>> it would be good to reference that either here or in include/cxl/cxl.h.
>
>
> Well, it is not that but I agree the description requires an update like;
>
>
> "flags for selecting RAM vs PMEM, and Type2 device."
>
>
> I think because the patch does not define the HDM-* as it is not needed yet, it should not be there.
>
Sounds good to me.
Thanks,
Ben
Powered by blists - more mailing lists