mbox series

[0/3] output buffer write fops fixes

Message ID 20230216101452.591805-1-nuno.sa@analog.com (mailing list archive)
Headers show
Series output buffer write fops fixes | expand

Message

Nuno Sa Feb. 16, 2023, 10:14 a.m. UTC
This patchset adds some fixes for output buffers:

1) Always return the number of bytes that we effectively copied;
2) Make sure we never block if O_NONBLOCK is passed.

With 2) some refactoring was done on the loop which makes it (IMHO) a bit
neater. Also note all of this is by code inspection and not really tested
on a real system. Even though the changes are fairly trivial, I do intend
to run a small test to make sure nothing basic broke.

Since I was touching this file, I jut felt I could fix all the checkpatch
complains :)

Nuno Sá (3):
  iio: buffer: correctly return bytes written in output buffers
  iio: buffer: make sure O_NONBLOCK is respected
  iio: buffer: fix coding style warnings

 drivers/iio/industrialio-buffer.c | 119 +++++++++++++++---------------
 1 file changed, 61 insertions(+), 58 deletions(-)