net/can: Add FAR specifier and fix nxstyle issues

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
Petro Karashchenko 2023-09-15 22:05:19 +03:00 committed by Xiang Xiao
parent 588a7241a8
commit 5bee23da07

View file

@ -202,8 +202,8 @@ ssize_t can_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
#if defined(CONFIG_NET_CANPROTO_OPTIONS) && defined(CONFIG_NET_CAN_CANFD)
if (conn->fd_frames)
{
if (msg->msg_iov->iov_len != CANFD_MTU
&& msg->msg_iov->iov_len != CAN_MTU)
if (msg->msg_iov->iov_len != CANFD_MTU &&
msg->msg_iov->iov_len != CAN_MTU)
{
return -EINVAL;
}
@ -233,10 +233,11 @@ ssize_t can_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
#ifdef CONFIG_NET_CAN_RAW_TX_DEADLINE
if (msg->msg_controllen > sizeof(struct cmsghdr))
{
struct cmsghdr *cmsg = CMSG_FIRSTHDR(msg);
if (conn->tx_deadline && cmsg->cmsg_level == SOL_CAN_RAW
&& cmsg->cmsg_type == CAN_RAW_TX_DEADLINE
&& cmsg->cmsg_len == sizeof(struct timeval))
FAR struct cmsghdr *cmsg = CMSG_FIRSTHDR(msg);
if (conn->tx_deadline &&
cmsg->cmsg_level == SOL_CAN_RAW &&
cmsg->cmsg_type == CAN_RAW_TX_DEADLINE &&
cmsg->cmsg_len == sizeof(struct timeval))
{
state.pr_msgbuf = CMSG_DATA(cmsg); /* Buffer to cmsg data */
state.pr_msglen = cmsg->cmsg_len; /* len of cmsg data */