hujun260 commented on code in PR #15324:
URL: https://github.com/apache/nuttx/pull/15324#discussion_r1896784100


##########
include/nuttx/spinlock.h:
##########
@@ -451,21 +443,8 @@ irqstate_t spin_lock_irqsave_wo_note(FAR volatile 
spinlock_t *lock)
   irqstate_t ret;
   ret = up_irq_save();
 
-  if (NULL == lock)
-    {
-      int me = this_cpu();
-      if (0 == g_irq_spin_count[me])
-        {
-          spin_lock_wo_note(&g_irq_spin);
-        }
-
-      g_irq_spin_count[me]++;
-      DEBUGASSERT(0 != g_irq_spin_count[me]);
-    }
-  else
-    {
-      spin_lock_wo_note(lock);
-    }
+  DEBUGASSERT(lock);

Review Comment:
   done



##########
sched/clock/clock_gettime.c:
##########
@@ -58,15 +58,15 @@ static clock_t clock_process_runtime(FAR struct tcb_s *tcb)
 
   group = tcb->group;
 
-  flags = spin_lock_irqsave(NULL);
+  flags = spin_lock_irqsave(&group->lock);
   sq_for_every(&group->tg_members, curr)
     {
       tcb = container_of(curr, struct tcb_s, member);
 
       runtime += tcb->run_time;
     }
 
-  spin_unlock_irqrestore(NULL, flags);
+  spin_unlock_irqrestore(&group->lock, flags);

Review Comment:
   If we implement it in this way, it will result in adding multiple spinlocks 
to the group structure, thus increasing the size of the structure.
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to