Reading through your notes, everything seems reasonable, though I'm not sure I agree with the two pass notion, though I'll wait to see the patch set.
The enum is a good idea, *forehead slap*, I should have done it. If we have a local enum, why not just make it global (within the file) and allocate the table as I have once we know how many MRs are present? 6 eggs/half dozen though, I'm ultimately fine with either. On Thu, Oct 13, 2022, 4:58 AM Jonathan Cameron <jonathan.came...@huawei.com> wrote: > On Wed, 12 Oct 2022 14:21:15 -0400 > Gregory Price <gourry.memve...@gmail.com> wrote: > > > Included in this response is a recommended patch set on top of this > > patch that resolves a number of issues, including style and a heap > > corruption bug. > > > > The purpose of this patch set is to refactor the CDAT initialization > > code to support future patch sets that will introduce multi-region > > support in CXL Type3 devices. > > > > 1) Checkpatch errors in the immediately prior patch > > 2) Flatting of code in cdat initialization > > 3) Changes in allocation and error checking for cleanliness > > 4) Change in the allocation/free strategy of CDAT sub-tables to simplify > > multi-region allocation in the future. Also resolves a heap > > corruption bug > > 5) Refactor of CDAT initialization code into a function that initializes > > sub-tables per memory-region. > > > > Gregory Price (5): > > hw/mem/cxl_type3: fix checkpatch errors > > hw/mem/cxl_type3: Pull validation checks ahead of functional code > > hw/mem/cxl_type3: CDAT pre-allocate and check resources prior to work > > hw/mem/cxl_type3: Change the CDAT allocation/free strategy > > hw/mem/cxl_type3: Refactor CDAT sub-table entry initialization into a > > function > > > > hw/mem/cxl_type3.c | 240 +++++++++++++++++++++++---------------------- > > 1 file changed, 122 insertions(+), 118 deletions(-) > > > > Thanks, I'm going to roll this stuff into the original patch set for v8. > Some of this I already have (like the check patch stuff). > Some I may disagree with in which case I'll reply to the patches - note > I haven't looked at them in detail yet! > > Jonathan >