Skip to contentSkip to conversation

cxl: Add dummy function for cxl_memdev_attach_region for !CONFIG_CXL_REGION

PATCH Applied Dave Jiang 3 participants 4 messages Jun 10 – Jun 12 CXL

lore
Share & tools
lore

Dave Jiang

author maintainer
#0 lore raw

PATCH 1/1 cxl: Add dummy function for cxl_memdev_attach_region for !CONFIG_CXL_REGION

Add a dummy function that returns -EOPNOTSUPP for cxl_memdev_attach_region when CONFIG_CXL_REGION is not enabled. This allow sbuilding when cxl/core/region.o isn't built.

Fixes 9b1e70e8f9ec ("cxl/region: Introduce devm_cxl_probe_mem()")

https://lore.kernel.org/oe-kbuild-all/[email protected]/

---

Fix is against last patch of Dan's [1] series for Introduce devm_cxl_probe_mem() and fix region deletion.

[1]: https://lore.kernel.org/linux-cxl/[email protected]/T/#t

---
 drivers/cxl/cxlmem.h | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/cxl/cxlmem.h +7 -0
index d3bdd00f94b3..ed419d0c59f2 100644
@@ -115,7 +115,14 @@ struct cxl_attach_region {
 	struct range hpa_range;
 };
 
+#ifdef CONFIG_CXL_REGION
 int cxl_memdev_attach_region(struct cxl_memdev *cxlmd);
+#else
+static inline int cxl_memdev_attach_region(struct cxl_memdev *cxlmd)
+{
+	return -EOPNOTSUPP;
+}
+#endif
 
 struct cxl_memdev *devm_cxl_add_classdev(struct cxl_dev_state *cxlds);
 struct cxl_memdev *__devm_cxl_add_memdev(struct cxl_dev_state *cxlds,

base-commit: 9b1e70e8f9ec4b5c6ce7fa774a0023bb6894c686

Signature · 1 line
2.54.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Dave Jiang

Add a dummy function that returns -EOPNOTSUPP for cxl_memdev_attach_region when CONFIG_CXL_REGION is not enabled. This allow sbuilding when cxl/core/region.o isn't built.

Thought above could be more explicit about what it allows building. Something like: 'This allows building cxl/core/memdev.o when ....'

With or without a commit log update:

maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Dave Jiang
Quoted 6 lines · Dave Jiang

Add a dummy function that returns -EOPNOTSUPP for cxl_memdev_attach_region when CONFIG_CXL_REGION is not enabled. This allow sbuilding when cxl/core/region.o isn't built.

Fixes 9b1e70e8f9ec ("cxl/region: Introduce devm_cxl_probe_mem()")
Quoted 8 lines

https://lore.kernel.org/oe-kbuild-all/[email protected]/

---

Fix is against last patch of Dan's [1] series for Introduce devm_cxl_probe_mem() and fix region deletion.

[1]: https://lore.kernel.org/linux-cxl/[email protected]/T/#t

Looks good:

author maintainer Applied
#3 lore raw
In reply to Dave Jiang
Quoted 8 lines · Dave Jiang

Add a dummy function that returns -EOPNOTSUPP for cxl_memdev_attach_region when CONFIG_CXL_REGION is not enabled. This allow sbuilding when cxl/core/region.o isn't built.

Fixes 9b1e70e8f9ec ("cxl/region: Introduce devm_cxl_probe_mem()")

https://lore.kernel.org/oe-kbuild-all/[email protected]/

Applied to cxl/next
383f69656359

Quoted 31 lines

---

Fix is against last patch of Dan's [1] series for Introduce devm_cxl_probe_mem() and fix region deletion.

[1]: https://lore.kernel.org/linux-cxl/[email protected]/T/#t

---
 drivers/cxl/cxlmem.h | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/cxl/cxlmem.h +7 -0
index d3bdd00f94b3..ed419d0c59f2 100644
@@ -115,7 +115,14 @@ struct cxl_attach_region {
 	struct range hpa_range;
 };
 
+#ifdef CONFIG_CXL_REGION
 int cxl_memdev_attach_region(struct cxl_memdev *cxlmd);
+#else
+static inline int cxl_memdev_attach_region(struct cxl_memdev *cxlmd)
+{
+	return -EOPNOTSUPP;
+}
+#endif
 
 struct cxl_memdev *devm_cxl_add_classdev(struct cxl_dev_state *cxlds);
 struct cxl_memdev *__devm_cxl_add_memdev(struct cxl_dev_state *cxlds,

base-commit: 9b1e70e8f9ec4b5c6ce7fa774a0023bb6894c686