linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hung-Chun Tseng <alan.tseng.cs@gmail.com>
To: "Sumit Semwal" <sumit.semwal@linaro.org>,
	"Christian König" <christian.koenig@amd.com>
Cc: linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org,
	Hung-Chun Tseng <alan.tseng.cs@gmail.com>
Subject: [PATCH v2] dma-buf: fix stale return value documentation for dma_buf_set_name()
Date: Wed,  2 Sep 2026 21:59:23 +0800	[thread overview]
Message-ID: <20260902135923.3599022-1-alan.tseng.cs@gmail.com> (raw)

The kernel-doc for dma_buf_set_name() still documents an -EBUSY return
for the case where the dma-buf is already attached to devices:

  Returns 0 on success. If the dma-buf buffer is already attached to
  devices, return -EBUSY.

That has not been true since commit e73c317efbf9 ("dma-buf: remove
restriction of IOCTL:DMA_BUF_SET_NAME"), which dropped the
dma_resv_lock() and the !list_empty(&dmabuf->attachments) check that
produced -EBUSY. That commit updated the description paragraph above,
but left the return value description behind.

The only failure the function can report now comes from strndup_user(),
propagated via PTR_ERR(); every other path returns 0. Document that
instead, using a Return: section so kernel-doc picks it up.

No functional change.

Fixes: e73c317efbf9 ("dma-buf: remove restriction of IOCTL:DMA_BUF_SET_NAME")
Signed-off-by: Hung-Chun Tseng <alan.tseng.cs@gmail.com>
---
Changes in v2:
 - Use a "Return:" section so kernel-doc actually parses the return
   value description; scripts/kernel-doc -none -Wall reported "No
   description found for return value of 'dma_buf_set_name'" before
   this change and is quiet after it.
 - Reference the commit that made the -EBUSY text stale, and add a
   Fixes: tag for it.
 - Resend to the dma-buf maintainers and dri-devel; v1 only reached
   linux-media, where it was marked "Not Applicable".

v1: https://lore.kernel.org/linux-media/20260730003153.4030818-1-alan.tseng.cs@gmail.com/

 drivers/dma-buf/dma-buf.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
index d504c636dc..6ee3c254d7 100644
--- a/drivers/dma-buf/dma-buf.c
+++ b/drivers/dma-buf/dma-buf.c
@@ -413,9 +413,8 @@ static __poll_t dma_buf_poll(struct file *file, poll_table *poll)
  * @buf:    [in]     A piece of userspace memory that contains the name of
  *                   the dma-buf.
  *
- * Returns 0 on success. If the dma-buf buffer is already attached to
- * devices, return -EBUSY.
- *
+ * Return: 0 on success, or a negative error code from strndup_user() on
+ * failure.
  */
 static long dma_buf_set_name(struct dma_buf *dmabuf, const char __user *buf)
 {
-- 
2.43.0


             reply	other threads:[~2026-09-02 13:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02 13:59 Hung-Chun Tseng [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-09-01 20:19 [PATCH v2] dma-buf: fix stale return value documentation for dma_buf_set_name() Hung-Chun Tseng
2026-07-30  0:31 [PATCH] " Hung-Chun Tseng
2026-07-30  0:50 ` [PATCH v2] " Hung-Chun Tseng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260902135923.3599022-1-alan.tseng.cs@gmail.com \
    --to=alan.tseng.cs@gmail.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=sumit.semwal@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).