You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ha...@apache.org on 2021/01/15 21:24:57 UTC

[incubator-nuttx] branch master updated: net/: Correct some comments.

This is an automated email from the ASF dual-hosted git repository.

hartmannathan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 6385408  net/: Correct some comments.
6385408 is described below

commit 638540848322cf77149c11ed5b48525dfd35a0ff
Author: Abdelatif Guettouche <ab...@espressif.com>
AuthorDate: Fri Jan 15 10:01:00 2021 +0100

    net/: Correct some comments.
    
    Signed-off-by: Abdelatif Guettouche <ab...@espressif.com>
---
 net/bluetooth/bluetooth_sockif.c   |  4 ++--
 net/can/can_sockif.c               | 10 +++++-----
 net/devif/devif_poll.c             |  4 ++--
 net/ieee802154/ieee802154_sockif.c |  4 ++--
 net/local/local_sockif.c           |  4 ++--
 net/pkt/pkt_send.c                 |  6 +++---
 net/pkt/pkt_sockif.c               |  8 ++++----
 net/utils/net_chksum.c             |  5 +++--
 net/utils/net_lock.c               |  8 ++++----
 9 files changed, 27 insertions(+), 26 deletions(-)

diff --git a/net/bluetooth/bluetooth_sockif.c b/net/bluetooth/bluetooth_sockif.c
index 9eeb533..bafa80c 100644
--- a/net/bluetooth/bluetooth_sockif.c
+++ b/net/bluetooth/bluetooth_sockif.c
@@ -177,8 +177,8 @@ static int bluetooth_sockif_alloc(FAR struct socket *psock)
 static int bluetooth_setup(FAR struct socket *psock, int protocol)
 {
   /* Allocate the appropriate connection structure.  This reserves the
-   * the connection structure is is unallocated at this point.  It will
-   * not actually be initialized until the socket is connected.
+   * connection structure, it is unallocated at this point.  It will not
+   * actually be initialized until the socket is connected.
    *
    * Only SOCK_RAW is supported
    */
diff --git a/net/can/can_sockif.c b/net/can/can_sockif.c
index 5571edf..3083ff7 100644
--- a/net/can/can_sockif.c
+++ b/net/can/can_sockif.c
@@ -189,7 +189,7 @@ static uint16_t can_poll_eventhandler(FAR struct net_driver_s *dev,
  * Input Parameters:
  *   psock    - A pointer to a user allocated socket structure to be
  *              initialized.
- *   protocol - NetLink socket protocol (see sys/socket.h)
+ *   protocol - CAN socket protocol (see sys/socket.h)
  *
  * Returned Value:
  *   Zero (OK) is returned on success.  Otherwise, a negated errno value is
@@ -226,7 +226,7 @@ static int can_setup(FAR struct socket *psock, int protocol)
 
   if (domain == PF_CAN && (type == SOCK_RAW || type == SOCK_DGRAM))
     {
-      /* Allocate the NetLink socket connection structure and save it in the
+      /* Allocate the CAN socket connection structure and save it in the
        * new socket instance.
        */
 
@@ -322,7 +322,7 @@ static void can_addref(FAR struct socket *psock)
  *   space (address family) but has no name assigned.
  *
  * Input Parameters:
- *   conn     NetLink socket connection structure
+ *   conn     CAN socket connection structure
  *   addr     Socket local address
  *   addrlen  Length of 'addr'
  *
@@ -384,7 +384,7 @@ static int can_bind(FAR struct socket *psock,
  *   the object pointed to by address is unspecified.
  *
  * Input Parameters:
- *   conn     NetLink socket connection structure
+ *   conn     CAN socket connection structure
  *   addr     sockaddr structure to receive data [out]
  *   addrlen  Length of sockaddr structure [in/out]
  *
@@ -801,7 +801,7 @@ static ssize_t can_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
  * Name: can_close
  *
  * Description:
- *   Performs the close operation on a NetLink socket instance
+ *   Performs the close operation on a CAN socket instance
  *
  * Input Parameters:
  *   psock   Socket instance
diff --git a/net/devif/devif_poll.c b/net/devif/devif_poll.c
index 15c42c7..c80063d 100644
--- a/net/devif/devif_poll.c
+++ b/net/devif/devif_poll.c
@@ -240,7 +240,7 @@ static int devif_poll_pkt_connections(FAR struct net_driver_s *dev,
 #endif /* CONFIG_NET_PKT */
 
 /****************************************************************************
- * Name: devif_poll_pkt_connections
+ * Name: devif_poll_can_connections
  *
  * Description:
  *   Poll all packet connections for available packets to send.
@@ -705,7 +705,7 @@ int devif_poll(FAR struct net_driver_s *dev, devif_poll_callback_t callback)
 #endif
 #ifdef CONFIG_NET_CAN
     {
-      /* Check for pending packet socket transfer */
+      /* Check for pending CAN socket transfer */
 
       bstop = devif_poll_can_connections(dev, callback);
     }
diff --git a/net/ieee802154/ieee802154_sockif.c b/net/ieee802154/ieee802154_sockif.c
index 19661e8..c831ed7 100644
--- a/net/ieee802154/ieee802154_sockif.c
+++ b/net/ieee802154/ieee802154_sockif.c
@@ -178,8 +178,8 @@ static int ieee802154_sockif_alloc(FAR struct socket *psock)
 static int ieee802154_setup(FAR struct socket *psock, int protocol)
 {
   /* Allocate the appropriate connection structure.  This reserves the
-   * the connection structure is is unallocated at this point.  It will
-   * not actually be initialized until the socket is connected.
+   * connection structure, it is unallocated at this point.  It will not
+   * actually be initialized until the socket is connected.
    *
    * Only SOCK_DGRAM is supported (since the MAC header is stripped)
    */
diff --git a/net/local/local_sockif.c b/net/local/local_sockif.c
index 1b589ff..ae2787b 100644
--- a/net/local/local_sockif.c
+++ b/net/local/local_sockif.c
@@ -178,8 +178,8 @@ static int local_sockif_alloc(FAR struct socket *psock)
 static int local_setup(FAR struct socket *psock, int protocol)
 {
   /* Allocate the appropriate connection structure.  This reserves the
-   * the connection structure is is unallocated at this point.  It will
-   * not actually be initialized until the socket is connected.
+   * connection structure, it is unallocated at this point.  It will not
+   * actually be initialized until the socket is connected.
    *
    * REVIST:  Only SOCK_STREAM and SOCK_DGRAM are supported.  Should also
    * support SOCK_RAW.
diff --git a/net/pkt/pkt_send.c b/net/pkt/pkt_send.c
index 2e66ecc..f539a70 100644
--- a/net/pkt/pkt_send.c
+++ b/net/pkt/pkt_send.c
@@ -163,7 +163,7 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev,
  *
  * Returned Value:
  *   On success, returns the number of characters sent.  On  error,
- *   a negated errno value is retruend.  See send() for the complete list
+ *   a negated errno value is returned.  See send() for the complete list
  *   of return values.
  *
  ****************************************************************************/
@@ -192,7 +192,7 @@ ssize_t psock_pkt_send(FAR struct socket *psock, FAR const void *buf,
 
   /* Perform the send operation */
 
-  /* Initialize the state structure. This is done with the network locked
+  /* Initialize the state structure.  This is done with the network locked
    * because we don't want anything to happen until we are ready.
    */
 
@@ -244,7 +244,7 @@ ssize_t psock_pkt_send(FAR struct socket *psock, FAR const void *buf,
   nxsem_destroy(&state.snd_sem);
   net_unlock();
 
-  /* Check for a errors, Errors are signalled by negative errno values
+  /* Check for errors.  Errors are signalled by negative errno values
    * for the send length
    */
 
diff --git a/net/pkt/pkt_sockif.c b/net/pkt/pkt_sockif.c
index 0824c11..3e1b9f0 100644
--- a/net/pkt/pkt_sockif.c
+++ b/net/pkt/pkt_sockif.c
@@ -176,8 +176,8 @@ static int pkt_sockif_alloc(FAR struct socket *psock)
 static int pkt_setup(FAR struct socket *psock, int protocol)
 {
   /* Allocate the appropriate connection structure.  This reserves the
-   * the connection structure is is unallocated at this point.  It will
-   * not actually be initialized until the socket is connected.
+   * connection structure, it is unallocated at this point.  It will not
+   * actually be initialized until the socket is connected.
    *
    * Only SOCK_RAW is supported.
    */
@@ -361,14 +361,14 @@ static int pkt_bind(FAR struct socket *psock,
       return -EBADF;
     }
 
-  /* Bind a raw socket to an network device. */
+  /* Bind a raw socket to a network device. */
 
   if (psock->s_type == SOCK_RAW)
     {
       FAR struct pkt_conn_s *conn = (FAR struct pkt_conn_s *)psock->s_conn;
       FAR struct net_driver_s *dev;
 
-      /* Look at the addr and identify network interface */
+      /* Look at the addr and identify the network interface */
 
       ifindex = ((FAR struct sockaddr_ll *)addr)->sll_ifindex;
 
diff --git a/net/utils/net_chksum.c b/net/utils/net_chksum.c
index 0242159..383d03a 100644
--- a/net/utils/net_chksum.c
+++ b/net/utils/net_chksum.c
@@ -51,7 +51,7 @@
  * Name: chksum
  *
  * Description:
- *   Calculate the raw change some over the memory region described by
+ *   Calculate the raw change sum over the memory region described by
  *   data and len.
  *
  * Input Parameters:
@@ -124,7 +124,8 @@ uint16_t chksum(uint16_t sum, FAR const uint8_t *data, uint16_t len)
  *
  *   buf - A pointer to the buffer over which the checksum is to be computed.
  *
- *   len - The length of the buffer over which the checksum is to be computed.
+ *   len - The length of the buffer over which the checksum is to be
+ *         computed.
  *
  * Returned Value:
  *   The Internet checksum of the buffer.
diff --git a/net/utils/net_lock.c b/net/utils/net_lock.c
index 645a5cc..bbc9677 100644
--- a/net/utils/net_lock.c
+++ b/net/utils/net_lock.c
@@ -394,11 +394,11 @@ int net_restorelock(unsigned int count)
  * Name: net_timedwait
  *
  * Description:
- *   Atomically wait for sem (or a timeout( while temporarily releasing
+ *   Atomically wait for sem (or a timeout) while temporarily releasing
  *   the lock on the network.
  *
  *   Caution should be utilized.  Because the network lock is relinquished
- *   during the wait, there could changes in the network state that occur
+ *   during the wait, there could be changes in the network state that occur
  *   before the lock is recovered.  Your design should account for this
  *   possibility.
  *
@@ -424,7 +424,7 @@ int net_timedwait(sem_t *sem, unsigned int timeout)
  *   Atomically wait for sem while temporarily releasing the network lock.
  *
  *   Caution should be utilized.  Because the network lock is relinquished
- *   during the wait, there could changes in the network state that occur
+ *   during the wait, there could be changes in the network state that occur
  *   before the lock is recovered.  Your design should account for this
  *   possibility.
  *
@@ -493,7 +493,7 @@ int net_lockedwait_uninterruptible(sem_t *sem)
  *   for the IOB while temporarily releasing the lock on the network.
  *
  *   Caution should be utilized.  Because the network lock is relinquished
- *   during the wait, there could changes in the network state that occur
+ *   during the wait, there could be changes in the network state that occur
  *   before the lock is recovered.  Your design should account for this
  *   possibility.
  *