mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:43:28 +08:00
netlink: Remove the dead code in netlink_close
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
@@ -719,7 +719,7 @@ enum
|
|||||||
PREFIX_UNSPEC,
|
PREFIX_UNSPEC,
|
||||||
PREFIX_ADDRESS,
|
PREFIX_ADDRESS,
|
||||||
PREFIX_CACHEINFO,
|
PREFIX_CACHEINFO,
|
||||||
PREFIX_MAX
|
PREFIX_MAX = PREFIX_CACHEINFO
|
||||||
};
|
};
|
||||||
|
|
||||||
struct prefix_cacheinfo
|
struct prefix_cacheinfo
|
||||||
@@ -801,7 +801,7 @@ enum
|
|||||||
{
|
{
|
||||||
NDUSEROPT_UNSPEC,
|
NDUSEROPT_UNSPEC,
|
||||||
NDUSEROPT_SRCADDR,
|
NDUSEROPT_SRCADDR,
|
||||||
NDUSEROPT_MAX
|
NDUSEROPT_MAX = NDUSEROPT_SRCADDR
|
||||||
};
|
};
|
||||||
|
|
||||||
/* This struct should be in sync with struct rtnl_link_stats64 */
|
/* This struct should be in sync with struct rtnl_link_stats64 */
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
FAR struct netlink_ext_ack *__extack = (extack); \
|
FAR struct netlink_ext_ack *__extack = (extack); \
|
||||||
if (__extack) \
|
if (__extack) \
|
||||||
{ \
|
{ \
|
||||||
__extack->msg = __msg; \
|
__extack->_msg = __msg; \
|
||||||
__extack->bad_attr = (attr); \
|
__extack->bad_attr = (attr); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
@@ -229,7 +229,7 @@ enum
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* struct netlink_ext_ack - netlink extended ACK report struct
|
/* struct netlink_ext_ack - netlink extended ACK report struct
|
||||||
* msg: message string to report - don't access directly, use
|
* _msg: message string to report - don't access directly, use
|
||||||
* nl_set_err_msg_attr
|
* nl_set_err_msg_attr
|
||||||
* bad_attr: attribute with error
|
* bad_attr: attribute with error
|
||||||
* cookie: cookie data to return to userspace (for success)
|
* cookie: cookie data to return to userspace (for success)
|
||||||
@@ -238,7 +238,7 @@ enum
|
|||||||
|
|
||||||
struct netlink_ext_ack
|
struct netlink_ext_ack
|
||||||
{
|
{
|
||||||
FAR const char *msg;
|
FAR const char *_msg;
|
||||||
FAR const struct nlattr *bad_attr;
|
FAR const struct nlattr *bad_attr;
|
||||||
uint8_t cookie[NETLINK_MAX_COOKIE_LEN];
|
uint8_t cookie[NETLINK_MAX_COOKIE_LEN];
|
||||||
uint8_t cookie_len;
|
uint8_t cookie_len;
|
||||||
|
|||||||
@@ -744,7 +744,6 @@ static ssize_t netlink_recvmsg(FAR struct socket *psock,
|
|||||||
static int netlink_close(FAR struct socket *psock)
|
static int netlink_close(FAR struct socket *psock)
|
||||||
{
|
{
|
||||||
FAR struct netlink_conn_s *conn = psock->s_conn;
|
FAR struct netlink_conn_s *conn = psock->s_conn;
|
||||||
int ret = OK;
|
|
||||||
|
|
||||||
/* Perform some pre-close operations for the NETLINK socket type. */
|
/* Perform some pre-close operations for the NETLINK socket type. */
|
||||||
|
|
||||||
@@ -758,14 +757,6 @@ static int netlink_close(FAR struct socket *psock)
|
|||||||
|
|
||||||
conn->crefs = 0;
|
conn->crefs = 0;
|
||||||
netlink_free(psock->s_conn);
|
netlink_free(psock->s_conn);
|
||||||
|
|
||||||
if (ret < 0)
|
|
||||||
{
|
|
||||||
/* Return with error code, but free resources. */
|
|
||||||
|
|
||||||
nerr("ERROR: netlink_close failed: %d\n", ret);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -774,7 +765,7 @@ static int netlink_close(FAR struct socket *psock)
|
|||||||
conn->crefs--;
|
conn->crefs--;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_NET_NETLINK */
|
#endif /* CONFIG_NET_NETLINK */
|
||||||
|
|||||||
Reference in New Issue
Block a user