Skip to content

Commit 9b89ca2

Browse files
linosanfilippo-kunbusl1k
authored andcommitted
pibridge-serdev: change semantic of pibridge_recv_timeout()
In function pibridge_recv_timeout() do not return 0 if the number of received bytes is smaller than the size of the provided receive buffer. Instead return the number of received bytes. Signed-off-by: Lino Sanfilippo <l.sanfilippo@kunbus.com>
1 parent 5849e2d commit 9b89ca2

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

drivers/tty/serdev/pibridge.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ int pibridge_recv_timeout(void *buf, u8 len, u16 timeout)
180180
{
181181
struct pibridge *pi = pibridge_s;
182182
unsigned int received;
183-
int ret = len;
184183

185184
trace_pibridge_receive_begin(len);
186185

@@ -193,12 +192,10 @@ int pibridge_recv_timeout(void *buf, u8 len, u16 timeout)
193192

194193
trace_pibridge_receive_end(buf, received);
195194

196-
if (received != len) {
195+
if (received != len)
197196
trace_pibridge_receive_timeout(received, len, timeout);
198-
ret = 0;
199-
}
200197

201-
return ret;
198+
return received;
202199
}
203200
EXPORT_SYMBOL(pibridge_recv_timeout);
204201

0 commit comments

Comments
 (0)