mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 05:06:09 +08:00
net/ip: fix compile break if enable NET_LOCAL_SCM
1.
net/slip.c:865:29: warning: unused variable ‘priv’ [-Wunused-variable]
865 | FAR struct slip_driver_s *priv =
| ^~~~
net/slip.c: In function ‘slip_rmmac’:
net/slip.c:895:29: warning: unused variable ‘priv’ [-Wunused-variable]
895 | FAR struct slip_driver_s *priv =
| ^~~~
2.
local/local_sendmsg.c: In function ‘local_sendmsg’:
local/local_sendmsg.c:423:18: warning: ‘count’ may be used uninitialized in this function [-Wmaybe-uninitialized]
423 | return count;
| ^~~~~
local/local_sendmsg.c:131:11: warning: ‘i’ may be used uninitialized in this function [-Wmaybe-uninitialized]
131 | while (i-- > 0)
| ~^~
local/local_sendmsg.c:71:7: note: ‘i’ was declared here
71 | int i;
| ^
Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
committed by
Petro Karashchenko
parent
e3a6c16944
commit
1cb11968b7
@@ -862,9 +862,6 @@ static int slip_txavail(FAR struct net_driver_s *dev)
|
|||||||
#ifdef CONFIG_NET_MCASTGROUP
|
#ifdef CONFIG_NET_MCASTGROUP
|
||||||
static int slip_addmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac)
|
static int slip_addmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac)
|
||||||
{
|
{
|
||||||
FAR struct slip_driver_s *priv =
|
|
||||||
(FAR struct slip_driver_s *)dev->d_private;
|
|
||||||
|
|
||||||
/* Add the MAC address to the hardware multicast routing table */
|
/* Add the MAC address to the hardware multicast routing table */
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
@@ -892,9 +889,6 @@ static int slip_addmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac)
|
|||||||
#ifdef CONFIG_NET_MCASTGROUP
|
#ifdef CONFIG_NET_MCASTGROUP
|
||||||
static int slip_rmmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac)
|
static int slip_rmmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac)
|
||||||
{
|
{
|
||||||
FAR struct slip_driver_s *priv =
|
|
||||||
(FAR struct slip_driver_s *)dev->d_private;
|
|
||||||
|
|
||||||
/* Add the MAC address to the hardware multicast routing table */
|
/* Add the MAC address to the hardware multicast routing table */
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
|
|||||||
@@ -65,10 +65,10 @@ static int local_sendctl(FAR struct local_conn_s *conn,
|
|||||||
FAR struct file *filep2;
|
FAR struct file *filep2;
|
||||||
FAR struct file *filep;
|
FAR struct file *filep;
|
||||||
struct cmsghdr *cmsg;
|
struct cmsghdr *cmsg;
|
||||||
int count;
|
int count = 0;
|
||||||
int *fds;
|
int *fds;
|
||||||
int ret;
|
int ret;
|
||||||
int i;
|
int i = 0;
|
||||||
|
|
||||||
net_lock();
|
net_lock();
|
||||||
|
|
||||||
@@ -412,7 +412,7 @@ ssize_t local_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
|
|||||||
size_t len = msg->msg_iovlen;
|
size_t len = msg->msg_iovlen;
|
||||||
#ifdef CONFIG_NET_LOCAL_SCM
|
#ifdef CONFIG_NET_LOCAL_SCM
|
||||||
FAR struct local_conn_s *conn = psock->s_conn;
|
FAR struct local_conn_s *conn = psock->s_conn;
|
||||||
int count;
|
int count = 0;
|
||||||
|
|
||||||
if (msg->msg_control &&
|
if (msg->msg_control &&
|
||||||
msg->msg_controllen > sizeof(struct cmsghdr))
|
msg->msg_controllen > sizeof(struct cmsghdr))
|
||||||
|
|||||||
Reference in New Issue
Block a user