1
0
Fork 0
forked from nuttx/nuttx-update

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:
chao an 2023-02-07 17:01:31 +08:00 committed by Petro Karashchenko
parent e3a6c16944
commit 1cb11968b7
2 changed files with 3 additions and 9 deletions

View file

@ -862,9 +862,6 @@ static int slip_txavail(FAR struct net_driver_s *dev)
#ifdef CONFIG_NET_MCASTGROUP
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 */
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
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 */
return OK;

View file

@ -65,10 +65,10 @@ static int local_sendctl(FAR struct local_conn_s *conn,
FAR struct file *filep2;
FAR struct file *filep;
struct cmsghdr *cmsg;
int count;
int count = 0;
int *fds;
int ret;
int i;
int i = 0;
net_lock();
@ -412,7 +412,7 @@ ssize_t local_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
size_t len = msg->msg_iovlen;
#ifdef CONFIG_NET_LOCAL_SCM
FAR struct local_conn_s *conn = psock->s_conn;
int count;
int count = 0;
if (msg->msg_control &&
msg->msg_controllen > sizeof(struct cmsghdr))