Skip to contentSkip to conversation

drm/gem-dma: Correct GEM object wrapper documentation

PATCH In review Karl Mehltretter 2 participants 3 messages Sep 12

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/gem-dma: Correct GEM object wrapper documentation

The drm_gem_dma_object_free() wrapper calls drm_gem_dma_free(), but its description still names the former drm_gem_dma_free_object() helper. Update the reference to match the wrapped function.

Also correct drm_gem_dma_object_get_sg_table() to document an error pointer on failure. It forwards the result of drm_gem_dma_get_sg_table(), which returns ERR_PTR() rather than NULL on failure.

Fixes e580ea25c08d ("drm/cma-helper: Pass GEM CMA object in public interfaces")
Fixes 05b1de51df07 ("drm/cma-helper: Export dedicated wrappers for GEM object functions")
Assisted-by LLM
---
 include/drm/drm_gem_dma_helper.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
include/drm/drm_gem_dma_helper.h +3 -2
index f2678e7ecb9847917e9c6c0287af9815d54bae79..5defd47d7de425515c76391d1825f0ed28077eaa 100644
@@ -52,7 +52,7 @@ extern const struct vm_operations_struct drm_gem_dma_vm_ops;
  * drm_gem_dma_object_free - GEM object function for drm_gem_dma_free()
  * @obj: GEM object to free
  *
- * This function wraps drm_gem_dma_free_object(). Drivers that employ the DMA helpers
+ * This function wraps drm_gem_dma_free(). Drivers that employ the DMA helpers
  * should use it as their &drm_gem_object_funcs.free handler.
  */
 static inline void drm_gem_dma_object_free(struct drm_gem_object *obj)
@@ -87,7 +87,8 @@ static inline void drm_gem_dma_object_print_info(struct drm_printer *p, unsigned
  * use it as their &drm_gem_object_funcs.get_sg_table handler.
  *
  * Returns:
- * A pointer to the scatter/gather table of pinned pages or NULL on failure.
+ * A pointer to the scatter/gather table of pinned pages on success, or
+ * an ERR_PTR() on failure.
  */
 static inline struct sg_table *drm_gem_dma_object_get_sg_table(struct drm_gem_object *obj)
 {
Signature · 1 line
2.39.5 (Apple Git-154)
#1 lore raw
Quoted 4 lines · Karl Mehltretter

The drm_gem_dma_object_free() wrapper calls drm_gem_dma_free(), but its description still names the former drm_gem_dma_free_object() helper. Update the reference to match the wrapped function.

Quoted 8 lines

Also correct drm_gem_dma_object_get_sg_table() to document an error pointer on failure. It forwards the result of drm_gem_dma_get_sg_table(), which returns ERR_PTR() rather than NULL on failure.

Fixes e580ea25c08d ("drm/cma-helper: Pass GEM CMA object in public interfaces")
Fixes 05b1de51df07 ("drm/cma-helper: Export dedicated wrappers for GEM object functions")
Assisted-by LLM

Throwing LLMs at this kind of things is neither a good use of computing resources nor a good use of maintainer time. Please refrain from doing so in the future.

Quoted 28 lines
---
 include/drm/drm_gem_dma_helper.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
include/drm/drm_gem_dma_helper.h +3 -2
index f2678e7ecb9847917e9c6c0287af9815d54bae79..5defd47d7de425515c76391d1825f0ed28077eaa 100644
@@ -52,7 +52,7 @@ extern const struct vm_operations_struct drm_gem_dma_vm_ops;
  * drm_gem_dma_object_free - GEM object function for drm_gem_dma_free()
  * @obj: GEM object to free
  *
- * This function wraps drm_gem_dma_free_object(). Drivers that employ the DMA helpers
+ * This function wraps drm_gem_dma_free(). Drivers that employ the DMA helpers
  * should use it as their &drm_gem_object_funcs.free handler.
  */
 static inline void drm_gem_dma_object_free(struct drm_gem_object *obj)
@@ -87,7 +87,8 @@ static inline void drm_gem_dma_object_print_info(struct drm_printer *p, unsigned
  * use it as their &drm_gem_object_funcs.get_sg_table handler.
  *
  * Returns:
- * A pointer to the scatter/gather table of pinned pages or NULL on failure.
+ * A pointer to the scatter/gather table of pinned pages on success, or
+ * an ERR_PTR() on failure.
  */
 static inline struct sg_table *drm_gem_dma_object_get_sg_table(struct drm_gem_object *obj)
 {
Signature · 3 lines
Regards,

Laurent Pinchart
#2 lore raw
Quoted 8 lines · Laurent Pinchart
Quoted 3 lines
Fixes e580ea25c08d ("drm/cma-helper: Pass GEM CMA object in public interfaces")
Fixes 05b1de51df07 ("drm/cma-helper: Export dedicated wrappers for GEM object functions")
Assisted-by LLM

Throwing LLMs at this kind of things is neither a good use of computing resources nor a good use of maintainer time. Please refrain from doing so in the future.

I view it differently but respect your wish for drm.

Thanks,
Karl