summaryrefslogtreecommitdiff
path: root/libhw_cr/w5500.c
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-04-26 23:30:31 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-05-12 13:02:05 -0600
commit42729f477684b12735b572a4975d32fb1002a530 (patch)
tree8edcd3eede207af6d9ae2557f8fcb05290659597 /libhw_cr/w5500.c
parent5255dbd5196f0125b51d969c46e46ac5765db7ed (diff)
libhw_generic: io.h: Clarify that sum lenghts of iovecs must not be 0
Diffstat (limited to 'libhw_cr/w5500.c')
-rw-r--r--libhw_cr/w5500.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libhw_cr/w5500.c b/libhw_cr/w5500.c
index e676364..cb424b0 100644
--- a/libhw_cr/w5500.c
+++ b/libhw_cr/w5500.c
@@ -608,10 +608,9 @@ static ssize_t w5500_tcp_writev(struct _w5500_socket *socket, const struct iovec
size_t count = 0;
for (int i = 0; i < iovcnt; i++)
count += iov[i].iov_len;
+ assert(count);
log_debugf("tcp_conn.write(%zu)", count);
ASSERT_SELF(stream_conn, TCP);
- if (count == 0)
- return 0;
/* What we really want is to pause until we receive an ACK for
* some data we just queued, so that we can line up some new
@@ -701,10 +700,9 @@ static ssize_t w5500_tcp_readv(struct _w5500_socket *socket, const struct iovec
size_t count = 0;
for (int i = 0; i < iovcnt; i++)
count += iov[i].iov_len;
+ assert(count);
log_debugf("tcp_conn.read(%zu)", count);
ASSERT_SELF(stream_conn, TCP);
- if (count == 0)
- return 0;
struct alarmclock_trigger trigger = {};
if (socket->read_deadline_ns)