All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] cxl/port: Cleanup add_port_attach_ep() "cleanup" confusion
@ 2024-10-18  1:10 Dan Williams
  2024-10-18  1:10 ` [PATCH v2 1/3] cxl/port: Revert usage of scoped_guard() Dan Williams
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Dan Williams @ 2024-10-18  1:10 UTC (permalink / raw)
  To: ira.weiny, dave.jiang; +Cc: Li Ming, Jonathan Cameron, Dan Carpenter, linux-cxl

Changes since v1 [1]:
- there is no bug fixed by these changes (Jonathan)
- lets take the time to improve the subtlety (Jonathan)

Dan's recent smatch report [2] highlighted that add_port_attach_ep() is
unreasonably subtle, aka ugly. The recent cleanup conversions did not
improve the situation and instead actively contributed to the poor
readability.

Given that this routine is core to CXL port enumeration it is worth
investing readability improvements. So, first, back out the
scope-based-cleanup helper conversions that were built on an ugly
foundation. Then, refactor add_port_attach_ep() with a new
find_add_dport() helper that clarifies the flow.

This is cxl-next material, not cxl-fixes.

[1]: http://lore.kernel.org/172912104335.1414627.1377616790909088415.stgit@dwillia2-xfh.jf.intel.com
[2]: http://lore.kernel.org/2a19289b-0bcf-42c4-82a9-268a922535f2@stanley.mountain

---

Dan Williams (3):
      cxl/port: Revert usage of scoped_guard()
      cxl/port: Revert __free() conversion of add_port_attach_ep()
      cxl/port: Clarify add_port_attach_ep()


 drivers/cxl/core/port.c   |  121 ++++++++++++++++++++++++++-------------------
 drivers/cxl/core/region.c |   25 ++++-----
 drivers/cxl/cxl.h         |    1 
 drivers/cxl/mem.c         |   22 ++++----
 drivers/cxl/pmem.c        |   16 +++---
 5 files changed, 105 insertions(+), 80 deletions(-)

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-11-12 16:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-18  1:10 [PATCH v2 0/3] cxl/port: Cleanup add_port_attach_ep() "cleanup" confusion Dan Williams
2024-10-18  1:10 ` [PATCH v2 1/3] cxl/port: Revert usage of scoped_guard() Dan Williams
2024-11-12 16:42   ` Ira Weiny
2024-10-18  1:10 ` [PATCH v2 2/3] cxl/port: Revert __free() conversion of add_port_attach_ep() Dan Williams
2024-11-12 16:42   ` Ira Weiny
2024-10-18  1:10 ` [PATCH v2 3/3] cxl/port: Clarify add_port_attach_ep() Dan Williams
2024-10-18 11:04   ` Jonathan Cameron
2024-10-18 19:47     ` Dan Williams

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.