You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/03/08 15:06:57 UTC

[incubator-nuttx-apps] 09/09: apps: examples: nxstyle fixes

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

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

commit 39847961560ad96744e38aab9c486dc1fe8f5a41
Author: Alin Jerpelea <al...@sony.com>
AuthorDate: Tue Mar 8 09:57:25 2022 +0000

    apps: examples: nxstyle fixes
    
    Fix for errors reported by the nxstyle tool.
    
    Signed-off-by: Alin Jerpelea <al...@sony.com>
---
 examples/lvgldemo/tp_cal.c        |  2 +-
 examples/lvgldemo/tp_cal.h        |  4 +-
 examples/max31855/max31855_main.c | 34 ++++++++++------
 examples/netpkt/netpkt_main.c     | 23 +++++++----
 examples/nxdemo/images.h          | 16 +++++---
 examples/nxdemo/nxdemo_bkgd.c     | 17 ++++----
 examples/nxdemo/nxdemo_main.c     | 85 ++++++++++++++++++++-------------------
 examples/relays/relays_main.c     |  6 +--
 netutils/esp8266/esp8266.c        | 60 +++++++++++++--------------
 9 files changed, 135 insertions(+), 112 deletions(-)

diff --git a/examples/lvgldemo/tp_cal.c b/examples/lvgldemo/tp_cal.c
index 29be5b9..ccb067a 100644
--- a/examples/lvgldemo/tp_cal.c
+++ b/examples/lvgldemo/tp_cal.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * apps/examples/touchscreen/tp_cal.c
+ * apps/examples/lvgldemo/tp_cal.c
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
diff --git a/examples/lvgldemo/tp_cal.h b/examples/lvgldemo/tp_cal.h
index 45f5b81..409f632 100644
--- a/examples/lvgldemo/tp_cal.h
+++ b/examples/lvgldemo/tp_cal.h
@@ -47,7 +47,7 @@ extern "C"
 void tp_cal_create(void);
 
 #ifdef __cplusplus
-} /* extern "C" */
+}
 #endif
 
-#endif /*__APPS_EXAMPLES_LVGLDEMO_TP_CAL_H*/
+#endif /* __APPS_EXAMPLES_LVGLDEMO_TP_CAL_H */
diff --git a/examples/max31855/max31855_main.c b/examples/max31855/max31855_main.c
index bbf8630..97e5af8 100644
--- a/examples/max31855/max31855_main.c
+++ b/examples/max31855/max31855_main.c
@@ -82,12 +82,14 @@ int main(int argc, FAR char *argv[])
   /* Start reading each file and print sensor temperature if acquired */
 
   printf("Starting...\n");
-  while(1)
+  while (1)
     {
       printf("Channel SSP0/SPI1 Device 0: ");
       if (fd0 < 0)
         {
-          /* The file could not be open, probably the device is not registered */
+          /* The file could not be open,
+           * probably the device is not registered
+           */
 
           printf("Not enabled!\n");
         }
@@ -106,14 +108,16 @@ int main(int argc, FAR char *argv[])
             {
               /* Print temperature value of target device */
 
-              printf("Temperature = %d!\n",temp/4);
+              printf("Temperature = %d!\n", temp / 4);
             }
         }
 
       printf("Channel SSP0/SPI1 Device 1: ");
       if (fd1 < 0)
         {
-          /* The file could not be open, probably the device is not registered */
+          /* The file could not be open,
+           * probably the device is not registered
+           */
 
           printf("Not enabled!\n");
         }
@@ -122,8 +126,8 @@ int main(int argc, FAR char *argv[])
           ret = read(fd1, &temp, 2);
           if (ret < 0)
             {
-              /* The file could not be read, probably some max31855 pin is not
-               * connected to the channel.
+              /* The file could not be read, probably some max31855 pin is
+               * not connected to the channel.
                */
 
               printf("Disconnected!\n");
@@ -132,14 +136,16 @@ int main(int argc, FAR char *argv[])
             {
               /* Print temperature value of target device */
 
-              printf("Temperature = %d!\n",temp/4);
+              printf("Temperature = %d!\n", temp / 4);
             }
         }
 
       printf("Channel SSP1/SPI2 Device 0: ");
       if (fd2 < 0)
         {
-          /* The file could not be open, probably the device is not registered */
+          /* The file could not be open,
+           * probably the device is not registered
+           */
 
           printf("Not enabled!\n");
         }
@@ -148,8 +154,8 @@ int main(int argc, FAR char *argv[])
           ret = read(fd2, &temp, 2);
           if (ret < 0)
             {
-              /* The file could not be read, probably some max31855 pin is not
-               * connected to the channel.
+              /* The file could not be read, probably some max31855 pin is
+               * not connected to the channel.
                */
 
               printf("Disconnected!\n");
@@ -158,14 +164,16 @@ int main(int argc, FAR char *argv[])
             {
               /* Print temperature value of target device */
 
-              printf("Temperature = %d!\n",temp/4);
+              printf("Temperature = %d!\n", temp / 4);
             }
         }
 
       printf("Channel SSP1/SPI2 Device 1: ");
       if (fd3 < 0)
         {
-          /* The file could not be open, probably the device is not registered */
+          /* The file could not be open,
+           * probably the device is not registered
+           */
 
           printf("Not enabled!\n");
         }
@@ -184,7 +192,7 @@ int main(int argc, FAR char *argv[])
             {
               /* Print temperature value of target device */
 
-              printf("Temperature = %d!\n",temp/4);
+              printf("Temperature = %d!\n", temp / 4);
             }
         }
 
diff --git a/examples/netpkt/netpkt_main.c b/examples/netpkt/netpkt_main.c
index e17420c..94a37f0 100644
--- a/examples/netpkt/netpkt_main.c
+++ b/examples/netpkt/netpkt_main.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * net/recvfrom.c
+ * apps/examples/netpkt/netpkt_main.c
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -76,11 +76,11 @@ static void print_buf(const uint8_t *buf, int len)
     {
       printf("%02X", buf[i]);
 
-      if ((i+1) % 16 == 0 || (i+1) == len)
+      if ((i + 1) % 16 == 0 || (i + 1) == len)
         {
           printf("\n");
         }
-      else if ((i+1) % 8 == 0)
+      else if ((i + 1) % 8 == 0)
         {
           printf("  ");
         }
@@ -88,7 +88,7 @@ static void print_buf(const uint8_t *buf, int len)
         {
           printf(" ");
         }
-  }
+    }
 }
 
 /****************************************************************************
@@ -122,8 +122,15 @@ int main(int argc, FAR char *argv[])
   int rxc;
   uint8_t *buf;
   const int buflen = 128;
-  const char da[6] = {0xf0, 0xde, 0xf1, 0x02, 0x43, 0x01};
-  const char sa[6] = {0x00, 0xe0, 0xde, 0xad, 0xbe, 0xef};
+  const char da[6] =
+    {
+      0xf0, 0xde, 0xf1, 0x02, 0x43, 0x01
+    };
+
+  const char sa[6] =
+    {
+      0x00, 0xe0, 0xde, 0xad, 0xbe, 0xef
+    };
 
   int opt;
   int verbose = 0;
@@ -142,7 +149,7 @@ int main(int argc, FAR char *argv[])
 
   while ((opt = getopt(argc, argv, "artv")) != -1)
     {
-      switch(opt)
+      switch (opt)
         {
           case 'a':
             do_rx = 1;
@@ -179,7 +186,7 @@ int main(int argc, FAR char *argv[])
       buf = malloc(buflen);
       memset(buf, 0, buflen);
       memcpy(buf, da, 6);
-      memcpy(buf+6, sa, 6);
+      memcpy(buf + 6, sa, 6);
       for (i = 0; i < do_txtimes; i++)
         {
           if ((txc = write(sd, buf, buflen)) < 0)
diff --git a/examples/nxdemo/images.h b/examples/nxdemo/images.h
index 2c0aea7..a3bed78 100644
--- a/examples/nxdemo/images.h
+++ b/examples/nxdemo/images.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * apps/examples/nxdemo/nxdemo.h
+ * apps/examples/nxdemo/images.h
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -31,12 +31,16 @@
  * Public Data
  ****************************************************************************/
 
-static uint8_t g_battery [] =
+static uint8_t g_battery[] =
 {
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xfc, 0x10, 0x00, 0x04, 0x37, 0x77,
-  0x74, 0x37, 0x77, 0x74, 0x37, 0x77, 0x74, 0x37, 0x77, 0x74, 0x10, 0x00, 0x04, 0x0f, 0xff, 0xfc,
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x0f, 0xff, 0xfc, 0x10, 0x00, 0x04, 0x37, 0x77,
+  0x74, 0x37, 0x77, 0x74, 0x37, 0x77, 0x74, 0x37,
+  0x77, 0x74, 0x10, 0x00, 0x04, 0x0f, 0xff, 0xfc,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
 
diff --git a/examples/nxdemo/nxdemo_bkgd.c b/examples/nxdemo/nxdemo_bkgd.c
index b8dd397..6eef6ee 100644
--- a/examples/nxdemo/nxdemo_bkgd.c
+++ b/examples/nxdemo/nxdemo_bkgd.c
@@ -80,7 +80,8 @@
 
 static void nxdemo_redraw(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
                           bool morem, FAR void *arg);
-static void nxdemo_position(NXWINDOW hwnd, FAR const struct nxgl_size_s *size,
+static void nxdemo_position(NXWINDOW hwnd,
+                            FAR const struct nxgl_size_s *size,
                             FAR const struct nxgl_point_s *pos,
                             FAR const struct nxgl_rect_s *bounds,
                             FAR void *arg);
@@ -137,10 +138,11 @@ static void nxdemo_redraw(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
  * Name: nxdemo_position
  ****************************************************************************/
 
-static void nxdemo_position(NXWINDOW hwnd, FAR const struct nxgl_size_s *size,
-                                FAR const struct nxgl_point_s *pos,
-                                FAR const struct nxgl_rect_s *bounds,
-                                FAR void *arg)
+static void nxdemo_position(NXWINDOW hwnd,
+                            FAR const struct nxgl_size_s *size,
+                            FAR const struct nxgl_point_s *pos,
+                            FAR const struct nxgl_rect_s *bounds,
+                            FAR void *arg)
 {
   /* Report the position */
 
@@ -276,7 +278,7 @@ static void nxdemo_demo_1(NXWINDOW hwnd)
   center.x = g_nxdemo.xres >> 1;
   center.y = g_nxdemo.yres >> 1;
 
-  for (i = 0; i<MIN(g_nxdemo.xres, g_nxdemo.yres)>> 1; i++)
+  for (i = 0; i < (MIN(g_nxdemo.xres, g_nxdemo.yres) >> 1); i++)
     {
       circle_radius = i;
 
@@ -334,7 +336,7 @@ static void nxdemo_demo_2(NXWINDOW hwnd)
   center.x = g_nxdemo.xres >> 1;
   center.y = g_nxdemo.yres >> 1;
 
-  for (i = 0; i<MIN(g_nxdemo.xres, g_nxdemo.yres)>> 1; i++)
+  for (i = 0; i < (MIN(g_nxdemo.xres, g_nxdemo.yres) >> 1); i++)
     {
       rect.pt1.x = center.x - i;
       rect.pt1.y = center.y - i;
@@ -360,7 +362,6 @@ static void nxdemo_demo_2(NXWINDOW hwnd)
 
   for (i = MIN(g_nxdemo.xres, g_nxdemo.yres) >> 1; i > 1; i--)
     {
-
       rect.pt1.x = center.x - i;
       rect.pt1.y = center.y - i;
       rect.pt2.x = center.x + i;
diff --git a/examples/nxdemo/nxdemo_main.c b/examples/nxdemo/nxdemo_main.c
index 3d5ba21..e09e018 100644
--- a/examples/nxdemo/nxdemo_main.c
+++ b/examples/nxdemo/nxdemo_main.c
@@ -58,6 +58,7 @@
  ****************************************************************************/
 
 /* Configuration ************************************************************/
+
 /* If not specified, assume that the hardware supports one video plane */
 
 #ifndef CONFIG_EXAMPLES_NXDEMO_VPLANE
@@ -115,7 +116,8 @@ static inline int nxdemo_initialize(void)
   ret = boardctl(BOARDIOC_NX_START, 0);
   if (ret < 0)
     {
-      printf("nxdemo_initialize: Failed to start the NX server: %d\n", errno);
+      printf("nxdemo_initialize: "
+             "Failed to start the NX server: %d\n", errno);
       return ERROR;
     }
 
@@ -124,52 +126,53 @@ static inline int nxdemo_initialize(void)
   g_nxdemo.hnx = nx_connect();
   if (g_nxdemo.hnx)
     {
-       pthread_attr_t attr;
+      pthread_attr_t attr;
 
 #ifdef CONFIG_VNCSERVER
       /* Setup the VNC server to support keyboard/mouse inputs */
 
-       struct boardioc_vncstart_s vnc =
-       {
-         0,  g_nxdemo.hnx
-       };
-
-       ret = boardctl(BOARDIOC_VNC_START, (uintptr_t)&vnc);
-       if (ret < 0)
-         {
-           printf("boardctl(BOARDIOC_VNC_START) failed: %d\n", ret);
-           nx_disconnect(g_nxdemo.hnx);
-           return ERROR;
-         }
+      struct boardioc_vncstart_s vnc =
+        {
+           0,  g_nxdemo.hnx
+        };
+
+      ret = boardctl(BOARDIOC_VNC_START, (uintptr_t)&vnc);
+      if (ret < 0)
+        {
+          printf("boardctl(BOARDIOC_VNC_START) failed: %d\n", ret);
+          nx_disconnect(g_nxdemo.hnx);
+          return ERROR;
+        }
 #endif
 
-       /* Start a separate thread to listen for server events.  This is probably
-        * the least efficient way to do this, but it makes this example flow more
-        * smoothly.
-        */
-
-       pthread_attr_init(&attr);
-       param.sched_priority = CONFIG_EXAMPLES_NXDEMO_LISTENERPRIO;
-       pthread_attr_setschedparam(&attr, &param);
-       pthread_attr_setstacksize(&attr, CONFIG_EXAMPLES_NXDEMO_LISTENER_STACKSIZE);
-
-       ret = pthread_create(&thread, &attr, nxdemo_listener, NULL);
-       if (ret != 0)
-         {
-            printf("nxdemo_initialize: pthread_create failed: %d\n", ret);
-            return ERROR;
-         }
-
-       /* Don't return until we are connected to the server */
-
-       while (!g_nxdemo.connected)
-         {
-           /* Wait for the listener thread to wake us up when we really
-            * are connected.
-            */
-
-           sem_wait(&g_nxdemo.eventsem);
-         }
+      /* Start a separate thread to listen for server events.
+       * This is probably the least efficient way to do this,
+       * but it makes this example flow more smoothly.
+       */
+
+      pthread_attr_init(&attr);
+      param.sched_priority = CONFIG_EXAMPLES_NXDEMO_LISTENERPRIO;
+      pthread_attr_setschedparam(&attr, &param);
+      pthread_attr_setstacksize(&attr,
+                                CONFIG_EXAMPLES_NXDEMO_LISTENER_STACKSIZE);
+
+      ret = pthread_create(&thread, &attr, nxdemo_listener, NULL);
+      if (ret != 0)
+        {
+          printf("nxdemo_initialize: pthread_create failed: %d\n", ret);
+          return ERROR;
+        }
+
+      /* Don't return until we are connected to the server */
+
+      while (!g_nxdemo.connected)
+        {
+          /* Wait for the listener thread to wake us up when we really
+           * are connected.
+           */
+
+          sem_wait(&g_nxdemo.eventsem);
+        }
     }
   else
     {
diff --git a/examples/relays/relays_main.c b/examples/relays/relays_main.c
index 4c4e653..33b62dc 100644
--- a/examples/relays/relays_main.c
+++ b/examples/relays/relays_main.c
@@ -110,15 +110,15 @@ int main(int argc, FAR char *argv[])
   if (optind == argc - 1)
     {
       stat = argv[optind];
-      set_stat = (!strcmp(stat,"on") || !strcmp(stat,"ON")) ? true : false ;
+      set_stat = (strcmp(stat, "on") == 0 || strcmp(stat, "ON") == 0);
     }
 
   up_relaysinit();
 
   if (n >= 0)
     {
-      printf("set RELAY ID %d to %s\n", n , set_stat ? "ON" : "OFF");
-      relays_setstat(n,set_stat);
+      printf("set RELAY ID %d to %s\n", n, set_stat ? "ON" : "OFF");
+      relays_setstat(n, set_stat);
     }
   else
     {
diff --git a/netutils/esp8266/esp8266.c b/netutils/esp8266/esp8266.c
index 7301cac..163b486 100644
--- a/netutils/esp8266/esp8266.c
+++ b/netutils/esp8266/esp8266.c
@@ -70,32 +70,32 @@
 
 #define CON_NBR 4
 
-#define ESP8266_ACCESS_POINT_NBR_MAX 32
-
-#define LESP_WAITING_OK_POLLING_MS   250
-#define LESP_TIMEOUT_FLUSH_MS        100
-#define LESP_TIMEOUT_MS              1000
-#define LESP_TIMEOUT_MS_SEND         1000
-#define LESP_TIMEOUT_MS_CONNECTION   30000
-#define LESP_TIMEOUT_MS_LISP_AP      5000
+#define ESP8266_ACCESS_POINT_NBR_MAX   32
+
+#define LESP_WAITING_OK_POLLING_MS     250
+#define LESP_TIMEOUT_FLUSH_MS          100
+#define LESP_TIMEOUT_MS                1000
+#define LESP_TIMEOUT_MS_SEND           1000
+#define LESP_TIMEOUT_MS_CONNECTION     30000
+#define LESP_TIMEOUT_MS_LISP_AP        5000
 #define LESP_TIMEOUT_FLOODING_OFFSET_S 3
-#define LESP_TIMEOUT_MS_RECV_S       60
+#define LESP_TIMEOUT_MS_RECV_S         60
 
-#define LESP_CON_USED_MASK(idx)      (1<<(idx))
-#define LESP_POLLING_TIME_MS         1000
+#define LESP_CON_USED_MASK(idx)        (1<<(idx))
+#define LESP_POLLING_TIME_MS           1000
 
 /* Must be a power of 2 */
 
-#define SOCKET_FIFO_SIZE            2048
-#define SOCKET_NBR                  4
+#define SOCKET_FIFO_SIZE              2048
+#define SOCKET_NBR                    4
 
-#define FLAGS_SOCK_USED             (1 << 0)
-#define FLAGS_SOCK_CONNECTED        (1 << 1)
+#define FLAGS_SOCK_USED               (1 << 0)
+#define FLAGS_SOCK_CONNECTED          (1 << 1)
 
-#define FLAGS_SOCK_TYPE_MASK        (3 << 2)
-#define FLAGS_SOCK_TYPE_TCP         (0 << 2)
-#define FLAGS_SOCK_TYPE_UDP         (1 << 2)
-#define FLAGS_SOCK_TYPE_SSL         (2 << 2) /* non standard but useful */
+#define FLAGS_SOCK_TYPE_MASK          (3 << 2)
+#define FLAGS_SOCK_TYPE_TCP           (0 << 2)
+#define FLAGS_SOCK_TYPE_UDP           (1 << 2)
+#define FLAGS_SOCK_TYPE_SSL           (2 << 2) /* non standard but useful */
 
 /****************************************************************************
  * Private Types
@@ -744,8 +744,8 @@ int lesp_read_ans_ok(int timeout_ms)
     {
       ret = lesp_read(timeout_ms);
 
-      if ((ret < 0) || (g_lesp_state.and == LESP_ERR) || \
-           (time(NULL) > end))
+      if ((ret < 0) || (g_lesp_state.and == LESP_ERR) ||
+          (time(NULL) > end))
         {
           ret = -1;
           break;
@@ -1317,7 +1317,7 @@ static void *lesp_worker(void *args)
                       else
                         {
                           nerr("Worker and line is too long:%s\n",
-                                worker->rxbuf);
+                               worker->rxbuf);
                         }
                     }
 
@@ -1741,7 +1741,7 @@ int lesp_get_net(lesp_mode_t mode, in_addr_t *ip,
   if (ret >= 0)
     {
       ret = lesp_send_cmd("AT+CIP%s_CUR?\r\n",
-                          (mode == LESP_MODE_STATION)?"STA":"AP");
+                          (mode == LESP_MODE_STATION) ? "STA" : "AP");
     }
 
   if (ret >= 0)
@@ -1839,7 +1839,7 @@ int lesp_set_net(lesp_mode_t mode, in_addr_t ip,
     {
       ret = lesp_ask_ans_ok(LESP_TIMEOUT_MS, "AT+CIP%s_CUR=\"%d.%d.%d.%d\","
                             "\"%d.%d.%d.%d\",\"%d.%d.%d.%d\"\r\n",
-                            (mode == LESP_MODE_STATION)?"STA":"AP",
+                            (mode == LESP_MODE_STATION) ? "STA" : "AP",
                             *((uint8_t *)&(ip)+0), *((uint8_t *)&(ip)+1),
                             *((uint8_t *)&(ip)+2), *((uint8_t *)&(ip)+3),
                             *((uint8_t *)&(gateway)+0),
@@ -1888,7 +1888,7 @@ int lesp_set_dhcp(lesp_mode_t mode, bool enable)
   if (ret >= 0)
     {
       ret = lesp_ask_ans_ok(LESP_TIMEOUT_MS, "AT+CWDHCP_CUR=%d,%c\r\n",
-                            mode, (enable)?'1':'0');
+                            mode, enable ? '1' : '0');
     }
 
   pthread_mutex_unlock(&g_lesp_state.mutex);
@@ -2281,8 +2281,8 @@ int lesp_bind(int sockfd, FAR const struct sockaddr *addr, socklen_t addrlen)
  *
  ****************************************************************************/
 
-int lesp_connect(int sockfd,
-                 FAR const struct sockaddr *addr, socklen_t addrlen)
+int lesp_connect(int sockfd, FAR const struct sockaddr *addr,
+                 socklen_t addrlen)
 {
   int ret = 0;
   const char *proto_str;
@@ -2339,8 +2339,8 @@ int lesp_connect(int sockfd,
     {
       ret = lesp_ask_ans_ok(LESP_TIMEOUT_MS, "AT+CIPSTART=%d,\"%s\","
                             "\"%d.%d.%d.%d\",%d\r\n", sockfd, proto_str,
-                            *((uint8_t *)&(ip)+0), *((uint8_t *)&(ip)+1),
-                            *((uint8_t *)&(ip)+2), *((uint8_t *)&(ip)+3),
+                            *((uint8_t *)&ip + 0), *((uint8_t *)&ip +1),
+                            *((uint8_t *)&ip + 2), *((uint8_t *)&ip + 3),
                             port);
       if (ret < 0)
         {
@@ -2674,7 +2674,7 @@ int lesp_setsockopt(int sockfd, int level, int option,
               if (value_len == sizeof(struct timeval))
                 {
                   sock->rcv_timeo.tv_sec = ((struct timeval *)
-                                            (value))->tv_sec;
+                                             (value))->tv_sec;
                   sock->rcv_timeo.tv_nsec = ((struct timeval *)
                                              (value))->tv_usec;
                   sock->rcv_timeo.tv_nsec *= 1000; /* tv_usec to tv_nsec */