Alison Schofield wrote: > On Thu, Nov 24, 2022 at 10:35:10AM -0800, Dan Williams wrote: > > Accept any cxl_test topology device as the first argument in > > cxl_chbs_context. This is in preparation for reworking the detection of > > the component registers across VH and RCH topologies. Move > > mock_acpi_table_parse_cedt() beneath the definition of is_mock_port() > > and use is_mock_port() instead of the explicit mock cxl_acpi device > > check. > > I'll ACK this change, alhtough I don't appreciate the code move and modify > in the same patch. It hides the diff.
That's fair. I'll go ahead and just forward declare is_mock_port() which makes the diff easier to read: @@ -320,10 +320,12 @@ static int populate_cedt(void) return 0; } +static bool is_mock_port(struct device *dev); + /* - * WARNING, this hack assumes the format of 'struct - * cxl_cfmws_context' and 'struct cxl_chbs_context' share the property that - * the first struct member is the device being probed by the cxl_acpi + * WARNING, this hack assumes the format of 'struct cxl_cfmws_context' + * and 'struct cxl_chbs_context' share the property that the first + * struct member is cxl_test device being probed by the cxl_acpi * driver. */ struct cxl_cedt_context { @@ -340,7 +342,7 @@ static int mock_acpi_table_parse_cedt(enum acpi_cedt_type id, unsigned long end; int i; - if (dev != &cxl_acpi->dev) + if (!is_mock_port(dev) && !is_mock_dev(dev)) return acpi_table_parse_cedt(id, handler_arg, arg); if (id == ACPI_CEDT_TYPE_CHBS) > The commit msg seems needlessly vague. Why not state what was done? > Something like: 'Accept any topology device in cxl_chbs_context' I do start off with : "Accept any cxl_test topology device as the first argument in cxl_chbs_context", but I can move the rest to its own paragraph.