Thread (13 messages) 13 messages, 4 authors, 2023-12-18

Re: [PATCH v1] treewide, serdev: change receive_buf() return type to size_t

From: Johan Hovold <johan@kernel.org>
Date: 2023-12-15 16:32:33
Also in: chrome-platform, linux-arm-kernel, linux-bluetooth, linux-iio, linux-mediatek, linux-serial, linux-sound, lkml, platform-driver-x86

On Fri, Dec 15, 2023 at 02:59:35PM +0100, Francesco Dolcini wrote:
On Fri, Dec 15, 2023 at 02:51:09PM +0100, Johan Hovold wrote:
quoted
On Thu, Dec 14, 2023 at 06:01:46PM +0100, Francesco Dolcini wrote:
quoted
From: Francesco Dolcini <redacted>

receive_buf() is called from ttyport_receive_buf() that expects values
">= 0" from serdev_controller_receive_buf(), change its return type from
ssize_t to size_t.
quoted
quoted
 drivers/bluetooth/btmtkuart.c              |  4 ++--
 drivers/bluetooth/btnxpuart.c              |  4 ++--
quoted
quoted
-static ssize_t btnxpuart_receive_buf(struct serdev_device *serdev,
-				     const u8 *data, size_t count)
+static size_t btnxpuart_receive_buf(struct serdev_device *serdev,
+				    const u8 *data, size_t count)
 {
 	struct btnxpuart_dev *nxpdev = serdev_device_get_drvdata(serdev);
A quick check of just the first two functions here shows that they can
return negative values.
This is already fixed. Patches are in next.

There were 3 buggy user of this API.
 - 1 patch was merged a few days ago in mainline
 - 2 patches are in next, the maintainer decided to wait for the next merge window

commit 687d2de93b11 ("Bluetooth: btmtkuart: fix recv_buf() return value")
commit 7954bbcdd7ea ("Bluetooth: btnxpuart: fix recv_buf() return value")
commit c8820c92caf0 ("platform/surface: aggregator: fix recv_buf() return value")
Then why was that not mentioned in the patch (e.g. below the --- line)?

You are certainly not making it easy for reviewers, but good to see that
you thought about this, and I see now when reviewing the mail archives
that those bugs were the reason for this patch in the first place.

Johan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help