usrsock: Add DebugAssert for poll setup result

We never check its result and assume it will success, so an assert should be better than retval.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
This commit is contained in:
Zhe Weng 2023-02-17 14:58:18 +08:00 committed by Xiang Xiao
parent be0cb4cbe3
commit 9d53de374c

View file

@ -129,8 +129,8 @@ static int usrsock_rpmsg_ept_cb(FAR struct rpmsg_endpoint *ept,
FAR void *priv);
static void usrsock_rpmsg_poll_cb(FAR struct pollfd *pfds);
static int usrsock_rpmsg_poll_setup(FAR struct pollfd *pfds,
pollevent_t events);
static void usrsock_rpmsg_poll_setup(FAR struct pollfd *pfds,
pollevent_t events);
/****************************************************************************
* Private Data
@ -1021,8 +1021,8 @@ static int usrsock_rpmsg_ept_cb(FAR struct rpmsg_endpoint *ept,
return -EINVAL;
}
static int usrsock_rpmsg_poll_setup(FAR struct pollfd *pfds,
pollevent_t events)
static void usrsock_rpmsg_poll_setup(FAR struct pollfd *pfds,
pollevent_t events)
{
FAR struct usrsock_rpmsg_s *priv = (FAR struct usrsock_rpmsg_s *)pfds->arg;
int ret = 0;
@ -1050,7 +1050,7 @@ static int usrsock_rpmsg_poll_setup(FAR struct pollfd *pfds,
net_unlock();
return ret;
DEBUGASSERT(ret >= 0);
}
static void usrsock_rpmsg_poll_cb(FAR struct pollfd *pfds)