Skip to contentSkip to conversation

cxl/region: Fix the return value in devm_cxl_add_region() kernel-doc

PATCH Applied Karl Mehltretter 3 participants 3 messages Sep 11 – Sep 12 CXL

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cxl/region: Fix the return value in devm_cxl_add_region() kernel-doc

devm_cxl_add_region() returns the new struct cxl_region, or an ERR_PTR() on failure, but its kernel-doc says "0 if the region was added to the @cxlrd, else returns negative error code", which was never true. Describe the pointer.

Fixes 779dd20cfb56 ("cxl/region: Add region creation support")
Assisted-by LLM
---
 drivers/cxl/core/region.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cxl/core/region.c +1 -1
index 27e63e6dab7c82ccd6c34b7955f52789a32ce478..28a8e3d1e1231eef40bc30cdd937af980952232c 100644
@@ -2727,7 +2727,7 @@ void kill_regions(struct cxl_root_decoder *cxlrd)
  * This is the second step of region initialization. Regions exist within an
  * address space which is mapped by a @cxlrd.
  *
- * Return: 0 if the region was added to the @cxlrd, else returns negative error
+ * Return: the new region if it was added to the @cxlrd, else an ERR_PTR() with the error
  * code. The region will be named "regionZ" where Z is the unique region number.
  */
 static struct cxl_region *devm_cxl_add_region(struct cxl_root_decoder *cxlrd,
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · On Sat, 12 Sep 2026 00:17:48 +0200 Karl Mehltretter <[email protected]>…

devm_cxl_add_region() returns the new struct cxl_region, or an ERR_PTR() on failure, but its kernel-doc says "0 if the region was added to the @cxlrd, else returns negative error code", which was never true. Describe the pointer.

Fixes 779dd20cfb56 ("cxl/region: Add region creation support")
Assisted-by LLM
maintainer Applied
#2 lore raw
In reply to Karl Mehltretter
Quoted 8 lines · Karl Mehltretter

devm_cxl_add_region() returns the new struct cxl_region, or an ERR_PTR() on failure, but its kernel-doc says "0 if the region was added to the @cxlrd, else returns negative error code", which was never true. Describe the pointer.

Fixes 779dd20cfb56 ("cxl/region: Add region creation support")
Assisted-by LLM

Dropped fixes tag since it's just a comment fix and not code bug.

Applied to cxl/next
2dfb4796d19b

Quoted 17 lines
---
 drivers/cxl/core/region.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cxl/core/region.c +1 -1
index 27e63e6dab7c82ccd6c34b7955f52789a32ce478..28a8e3d1e1231eef40bc30cdd937af980952232c 100644
@@ -2727,7 +2727,7 @@ void kill_regions(struct cxl_root_decoder *cxlrd)
  * This is the second step of region initialization. Regions exist within an
  * address space which is mapped by a @cxlrd.
  *
- * Return: 0 if the region was added to the @cxlrd, else returns negative error
+ * Return: the new region if it was added to the @cxlrd, else an ERR_PTR() with the error
  * code. The region will be named "regionZ" where Z is the unique region number.
  */
 static struct cxl_region *devm_cxl_add_region(struct cxl_root_decoder *cxlrd,