You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/03/11 21:08:05 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5721: Remove the unnecessary code from nx_start

pkarashchenko commented on a change in pull request #5721:
URL: https://github.com/apache/incubator-nuttx/pull/5721#discussion_r825101900



##########
File path: mm/iob/iob_initialize.c
##########
@@ -95,54 +95,48 @@ sem_t g_qentry_sem;         /* Counts free I/O buffer queue containers */
 
 void iob_initialize(void)
 {
-  static bool initialized = false;
   int i;
 
-  /* Perform one-time initialization */
+  /* Add each I/O buffer to the free list */
 
-  if (!initialized)
+  for (i = 0; i < CONFIG_IOB_NBUFFERS; i++)
     {
-      /* Add each I/O buffer to the free list */
+      FAR struct iob_s *iob = &g_iob_pool[i];
 
-      for (i = 0; i < CONFIG_IOB_NBUFFERS; i++)
-        {
-          FAR struct iob_s *iob = &g_iob_pool[i];
+      /* Add the pre-allocate I/O buffer to the head of the free list */
 
-          /* Add the pre-allocate I/O buffer to the head of the free list */
-
-          iob->io_flink  = g_iob_freelist;
-          g_iob_freelist = iob;
-        }
+      iob->io_flink  = g_iob_freelist;
+      g_iob_freelist = iob;
+    }
 
-      g_iob_committed = NULL;
+  g_iob_committed = NULL;
 
-      nxsem_init(&g_iob_sem, 0, CONFIG_IOB_NBUFFERS);
+  nxsem_init(&g_iob_sem, 0, CONFIG_IOB_NBUFFERS);
 #if CONFIG_IOB_THROTTLE > 0
-      nxsem_init(&g_throttle_sem,
-                 0,
-                 CONFIG_IOB_NBUFFERS - CONFIG_IOB_THROTTLE);
+  nxsem_init(&g_throttle_sem,
+             0,
+             CONFIG_IOB_NBUFFERS - CONFIG_IOB_THROTTLE);
 #endif
 
 #if CONFIG_IOB_NCHAINS > 0
       /* Add each I/O buffer chain queue container to the free list */
 
-      for (i = 0; i < CONFIG_IOB_NCHAINS; i++)
-        {
-          FAR struct iob_qentry_s *iobq = &g_iob_qpool[i];
+  for (i = 0; i < CONFIG_IOB_NCHAINS; i++)
+    {
+      FAR struct iob_qentry_s *iobq = &g_iob_qpool[i];
 
-          /* Add the pre-allocate buffer container to the head of the free
-           * list
-           */
+      /* Add the pre-allocate buffer container to the head of the free
+       * list
+       */
 
-          iobq->qe_flink  = g_iob_freeqlist;
-          g_iob_freeqlist = iobq;
-        }
+      iobq->qe_flink  = g_iob_freeqlist;
+      g_iob_freeqlist = iobq;
+    }
 
-      g_iob_qcommitted = NULL;
+  g_iob_qcommitted = NULL;
 
-      nxsem_init(&g_qentry_sem, 0, CONFIG_IOB_NCHAINS);
+  nxsem_init(&g_qentry_sem, 0, CONFIG_IOB_NCHAINS);
 #endif
 
-      initialized = true;
-    }
+  initialized = true;

Review comment:
       Why do we need to keep this line?

##########
File path: sched/wdog/wd_initialize.c
##########
@@ -50,29 +50,3 @@ clock_t g_wdtickbase;
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
-
-/****************************************************************************
- * Name: wd_initialize
- *
- * Description:
- * This function initializes the watchdog data structures
- *
- * Input Parameters:
- *   None
- *
- * Returned Value:
- *   None
- *
- * Assumptions:
- *   This function must be called early in the initialization sequence
- *   before the timer interrupt is attached and before any watchdog
- *   services are used.
- *
- ****************************************************************************/
-
-void wd_initialize(void)
-{
-  /* Initialize watchdog lists */
-
-  sq_init(&g_wdactivelist);

Review comment:
       So we do nor need this call anymore? Why?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org