summaryrefslogtreecommitdiff
path: root/libhw_cr/w5500.c
diff options
context:
space:
mode:
Diffstat (limited to 'libhw_cr/w5500.c')
-rw-r--r--libhw_cr/w5500.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libhw_cr/w5500.c b/libhw_cr/w5500.c
index e676364..2893e8f 100644
--- a/libhw_cr/w5500.c
+++ b/libhw_cr/w5500.c
@@ -436,7 +436,7 @@ static void w5500_if_ifup(struct w5500 *chip, struct net_iface_config cfg) {
static void w5500_if_ifdown(struct w5500 *chip) {
log_debugf("if_down()");
- _w5500_if_up(chip, (struct net_iface_config){0});
+ _w5500_if_up(chip, (struct net_iface_config){});
}
static lo_interface net_stream_listener w5500_if_tcp_listen(struct w5500 *chip, uint16_t local_port) {
@@ -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)