From 7e748e63dd7196c0e9428651179f9cc289e78ea4 Mon Sep 17 00:00:00 2001 From: Alexander Lunev Date: Tue, 25 Jan 2022 19:28:24 +0300 Subject: [PATCH] net/tcp/tcp_sendfile: optimized out sendfile_txnotify() function --- net/tcp/tcp_sendfile.c | 51 ++---------------------------------------- 1 file changed, 2 insertions(+), 49 deletions(-) diff --git a/net/tcp/tcp_sendfile.c b/net/tcp/tcp_sendfile.c index c533e7fc6d..bae5d1af34 100644 --- a/net/tcp/tcp_sendfile.c +++ b/net/tcp/tcp_sendfile.c @@ -99,53 +99,6 @@ struct sendfile_s * Private Functions ****************************************************************************/ -/**************************************************************************** - * Name: sendfile_txnotify - * - * Description: - * Notify the appropriate device driver that we are have data ready to - * be send (TCP) - * - * Input Parameters: - * psock - Socket state structure - * conn - The TCP connection structure - * - * Returned Value: - * None - * - ****************************************************************************/ - -static inline void sendfile_txnotify(FAR struct socket *psock, - FAR struct tcp_conn_s *conn) -{ -#ifdef CONFIG_NET_IPv4 -#ifdef CONFIG_NET_IPv6 - /* If both IPv4 and IPv6 support are enabled, then we will need to select - * the device driver using the appropriate IP domain. - */ - - if (psock->s_domain == PF_INET) -#endif - { - /* Notify the device driver that send data is available */ - - netdev_ipv4_txnotify(conn->u.ipv4.laddr, conn->u.ipv4.raddr); - } -#endif /* CONFIG_NET_IPv4 */ - -#ifdef CONFIG_NET_IPv6 -#ifdef CONFIG_NET_IPv4 - else /* if (psock->s_domain == PF_INET6) */ -#endif /* CONFIG_NET_IPv4 */ - { - /* Notify the device driver that send data is available */ - - DEBUGASSERT(psock->s_domain == PF_INET6); - netdev_ipv6_txnotify(conn->u.ipv6.laddr, conn->u.ipv6.raddr); - } -#endif /* CONFIG_NET_IPv6 */ -} - /**************************************************************************** * Name: sendfile_eventhandler * @@ -434,7 +387,7 @@ static uint16_t sendfile_eventhandler(FAR struct net_driver_s *dev, /* Notify the device driver of the availability of TX data */ - sendfile_txnotify(psock, conn); + tcp_send_txnotify(psock, conn); /* Update the amount of data sent (but not necessarily ACKed) */ @@ -610,7 +563,7 @@ ssize_t tcp_sendfile(FAR struct socket *psock, FAR struct file *infile, /* Notify the device driver of the availability of TX data */ - sendfile_txnotify(psock, conn); + tcp_send_txnotify(psock, conn); for (; ; ) {