mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Malaya Kumar Rout <malayarout91@gmail.com>
To: linux-doc@vger.kernel.org
Cc: mrout@redhat.com, skhan@linuxfoundation.org,
	me@brighamcampbell.com,
	Malaya Kumar Rout <malayarout91@gmail.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Marneni PoornaChandu <poornachandumarneni@gmail.com>,
	Kevin Paul Reddy Janagari <kevinpaul468@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] docs: driver-api: usb: Document USBDEVFS_BULK return value and short reads
Date: Thu,  5 Mar 2026 23:37:50 +0530	[thread overview]
Message-ID: <20260305180753.114732-1-malayarout91@gmail.com> (raw)

Remove a longstanding FIXME comment in the USBDEVFS_BULK documentation
by properly documenting the return value behavior. The ioctl returns the
actual number of bytes transferred on success, which naturally handles
short reads (where fewer bytes are read than requested) by returning a
value less than the requested length.

This information was verified by examining the implementation in
drivers/usb/core/devio.c:do_proc_bulk(), which returns the actual
transfer length on success.

Signed-off-by: Malaya Kumar Rout <malayarout91@gmail.com>
---
 Documentation/driver-api/usb/usb.rst | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/driver-api/usb/usb.rst b/Documentation/driver-api/usb/usb.rst
index 7f2f41e80c1c..a01d72af479b 100644
--- a/Documentation/driver-api/usb/usb.rst
+++ b/Documentation/driver-api/usb/usb.rst
@@ -539,6 +539,12 @@ USBDEVFS_BULK
     kernels support requests up to about 128KBytes. *FIXME say how read
     length is returned, and how short reads are handled.*.
 
+    kernels support requests up to about 128KBytes. On success, the
+    ioctl returns the number of bytes actually transferred. Short reads
+    are supported; if fewer bytes are received than requested, only the
+    actual number of bytes received are copied to the buffer and that
+    count is returned. On error, a negative error code is returned.
+
 USBDEVFS_CLEAR_HALT
     Clears endpoint halt (stall) and resets the endpoint toggle. This is
     only meaningful for bulk or interrupt endpoints. The ioctl parameter
-- 
2.53.0


             reply	other threads:[~2026-03-05 18:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-05 18:07 Malaya Kumar Rout [this message]
2026-03-11 20:50 ` Brigham Campbell

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=20260305180753.114732-1-malayarout91@gmail.com \
    --to=malayarout91@gmail.com \
    --cc=corbet@lwn.net \
    --cc=kevinpaul468@gmail.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=me@brighamcampbell.com \
    --cc=mrout@redhat.com \
    --cc=poornachandumarneni@gmail.com \
    --cc=skhan@linuxfoundation.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

all inboxes | Powered by JetHome®