net/usrsock: Remove the unnecessary blank line

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-09-08 16:20:59 +08:00 committed by Masayuki Ishikawa
parent 3269c1a102
commit 77823415ed
7 changed files with 13 additions and 37 deletions

View File

@ -66,7 +66,7 @@ struct usrsockdev_s
int iovcnt; /* Number of request buffers */
size_t pos; /* Reader position on request buffer */
} req;
struct pollfd *pollfds[CONFIG_NET_USRSOCKDEV_NPOLLWAITERS];
FAR struct pollfd *pollfds[CONFIG_NET_USRSOCKDEV_NPOLLWAITERS];
};
/****************************************************************************
@ -233,7 +233,6 @@ static ssize_t usrsockdev_read(FAR struct file *filep, FAR char *buffer,
}
usrsockdev_semgive(&dev->devsem);
return len;
}
@ -302,7 +301,6 @@ static off_t usrsockdev_seek(FAR struct file *filep, off_t offset,
}
usrsockdev_semgive(&dev->devsem);
return pos;
}
@ -315,8 +313,8 @@ static ssize_t usrsockdev_write(FAR struct file *filep,
{
FAR struct inode *inode = filep->f_inode;
FAR struct usrsockdev_s *dev;
ssize_t ret = 0;
bool req_done = false;
ssize_t ret = 0;
if (len == 0)
{
@ -334,7 +332,7 @@ static ssize_t usrsockdev_write(FAR struct file *filep,
DEBUGASSERT(dev);
ret = (ssize_t)usrsockdev_semtake(&dev->devsem);
ret = usrsockdev_semtake(&dev->devsem);
if (ret < 0)
{
return ret;
@ -395,7 +393,6 @@ static int usrsockdev_open(FAR struct file *filep)
}
usrsockdev_semgive(&dev->devsem);
return ret;
}
@ -575,7 +572,6 @@ int usrsock_request(FAR struct iovec *iov, unsigned int iovcnt)
}
usrsockdev_semgive(&dev->devsem);
return ret;
}

View File

@ -428,7 +428,6 @@ int usrsock_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
*/
outaddrlen = state.valuelen_nontrunc;
ret = OK;
}
}

View File

@ -199,7 +199,6 @@ static ssize_t usrsock_handle_event(FAR const void *buffer, size_t len)
if (len < sizeof(*hdr))
{
nwarn("message too short, %zu < %zu.\n", len, sizeof(*hdr));
return -EINVAL;
}
@ -209,7 +208,6 @@ static ssize_t usrsock_handle_event(FAR const void *buffer, size_t len)
if (!conn)
{
nwarn("no active connection for usockid=%d.\n", hdr->usockid);
return -ENOENT;
}
@ -308,7 +306,6 @@ usrsock_handle_datareq_response(FAR struct usrsock_conn_s *conn,
*/
conn->resp.inprogress = true;
return sizeof(*datahdr);
}
@ -329,14 +326,12 @@ usrsock_handle_datareq_response(FAR struct usrsock_conn_s *conn,
{
nerr("error: response result negative, and valuelen or "
"valuelen_nontrunc non-zero.\n");
return -EINVAL;
}
/* Done with request/response. */
usrsock_event(conn);
return sizeof(*datahdr);
}
@ -348,7 +343,6 @@ usrsock_handle_datareq_response(FAR struct usrsock_conn_s *conn,
{
nwarn("not enough recv buffers (need: %d, have: %d).\n", num_inbufs,
conn->resp.datain.iovcnt);
return -EINVAL;
}
@ -362,10 +356,8 @@ usrsock_handle_datareq_response(FAR struct usrsock_conn_s *conn,
if (conn->resp.datain.iov[iovpos].iov_len < datahdr->valuelen)
{
nwarn("%dth buffer not large enough (need: %d, have: %zu).\n",
iovpos,
datahdr->valuelen,
iovpos, datahdr->valuelen,
conn->resp.datain.iov[iovpos].iov_len);
return -EINVAL;
}
@ -383,10 +375,8 @@ usrsock_handle_datareq_response(FAR struct usrsock_conn_s *conn,
{
nwarn("%dth buffer not large enough "
"(need: %" PRId32 ", have: %zu).\n",
iovpos,
hdr->result,
iovpos, hdr->result,
conn->resp.datain.iov[iovpos].iov_len);
return -EINVAL;
}
@ -445,7 +435,6 @@ static ssize_t usrsock_handle_req_response(FAR const void *buffer,
if (len < hdrlen)
{
nwarn("message too short, %zu < %zu.\n", len, hdrlen);
return -EINVAL;
}
@ -537,7 +526,6 @@ ssize_t usrsock_response(FAR const char *buffer, size_t len,
{
nwarn("message too short, %zu < %zu.\n", len,
sizeof(struct usrsock_message_common_s));
return -EINVAL;
}
@ -648,7 +636,6 @@ int usrsock_do_request(FAR struct usrsock_conn_s *conn,
req->ackxid = req_head->xid;
ret = usrsock_request(iov, iovcnt);
if (ret == OK)
{
/* Wait ack for request. */
@ -661,7 +648,6 @@ int usrsock_do_request(FAR struct usrsock_conn_s *conn,
/* Free request line for next command. */
nxsem_post(&req->sem);
return ret;
}

View File

@ -235,7 +235,6 @@ int usrsock_getsockopt(FAR struct usrsock_conn_s *conn,
errout_unlock:
net_unlock();
return ret;
}

View File

@ -248,7 +248,6 @@ int usrsock_ioctl(FAR struct socket *psock, int cmd, unsigned long arg_)
errout_unlock:
net_unlock();
return ret;
}

View File

@ -168,7 +168,6 @@ int usrsock_setsockopt(FAR struct usrsock_conn_s *conn,
int ret;
DEBUGASSERT(conn);
net_lock();
if (conn->state == USRSOCK_CONN_STATE_UNINITIALIZED ||

View File

@ -238,7 +238,6 @@ int usrsock_socket(int domain, int type, int protocol,
usrsock_teardown_request_callback(&state);
net_unlock();
return OK;
errout_teardown_callback:
@ -246,7 +245,6 @@ errout_teardown_callback:
errout_free_conn:
usrsock_free(conn);
net_unlock();
return err;
}