net/usrsock: Remove the unnecessary blank line
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
3269c1a102
commit
77823415ed
@ -58,15 +58,15 @@
|
||||
|
||||
struct usrsockdev_s
|
||||
{
|
||||
sem_t devsem; /* Lock for device node */
|
||||
uint8_t ocount; /* The number of times the device has been opened */
|
||||
sem_t devsem; /* Lock for device node */
|
||||
uint8_t ocount; /* The number of times the device has been opened */
|
||||
struct
|
||||
{
|
||||
FAR const struct iovec *iov; /* Pending request buffers */
|
||||
int iovcnt; /* Number of request buffers */
|
||||
size_t pos; /* Reader position on request buffer */
|
||||
FAR const struct iovec *iov; /* Pending request buffers */
|
||||
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];
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
@ -179,9 +179,9 @@ static void usrsockdev_pollnotify(FAR struct usrsockdev_s *dev,
|
||||
static ssize_t usrsockdev_read(FAR struct file *filep, FAR char *buffer,
|
||||
size_t len)
|
||||
{
|
||||
FAR struct inode *inode = filep->f_inode;
|
||||
FAR struct inode *inode = filep->f_inode;
|
||||
FAR struct usrsockdev_s *dev;
|
||||
int ret;
|
||||
int ret;
|
||||
|
||||
if (len == 0)
|
||||
{
|
||||
@ -233,7 +233,6 @@ static ssize_t usrsockdev_read(FAR struct file *filep, FAR char *buffer,
|
||||
}
|
||||
|
||||
usrsockdev_semgive(&dev->devsem);
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
@ -244,7 +243,7 @@ static ssize_t usrsockdev_read(FAR struct file *filep, FAR char *buffer,
|
||||
static off_t usrsockdev_seek(FAR struct file *filep, off_t offset,
|
||||
int whence)
|
||||
{
|
||||
FAR struct inode *inode = filep->f_inode;
|
||||
FAR struct inode *inode = filep->f_inode;
|
||||
FAR struct usrsockdev_s *dev;
|
||||
off_t pos;
|
||||
int ret;
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
@ -428,7 +428,6 @@ int usrsock_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
|
||||
*/
|
||||
|
||||
outaddrlen = state.valuelen_nontrunc;
|
||||
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -235,7 +235,6 @@ int usrsock_getsockopt(FAR struct usrsock_conn_s *conn,
|
||||
|
||||
errout_unlock:
|
||||
net_unlock();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -248,7 +248,6 @@ int usrsock_ioctl(FAR struct socket *psock, int cmd, unsigned long arg_)
|
||||
|
||||
errout_unlock:
|
||||
net_unlock();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -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 ||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user