mirror of
https://github.com/apache/nuttx.git
synced 2025-12-09 03:33:51 +08:00
arm/stm32: Replace spinlock/sched_lock with spin_lock_irqsave_nopreempt
Replace the spinlock/sched_lock pair in arm/stm32 with
spin_lock_irqsave_nopreempt() to improve code clarity and consistency.
Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
This commit is contained in:
committed by
Xiang Xiao
parent
028f4cd952
commit
5b4d2dda9d
@@ -2404,8 +2404,7 @@ static void hciuart_dma_rxcallback(DMA_HANDLE handle, uint8_t status,
|
||||
irqstate_t flags;
|
||||
ssize_t nbytes;
|
||||
|
||||
flags = spin_lock_irqsave(&config->lock);
|
||||
sched_lock();
|
||||
flags = spin_lock_irqsave_nopreempt(&config->lock);
|
||||
|
||||
if (config.state->rxdmastream == NULL)
|
||||
{
|
||||
@@ -2436,8 +2435,7 @@ static void hciuart_dma_rxcallback(DMA_HANDLE handle, uint8_t status,
|
||||
handled = true;
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&config->lock, flags);
|
||||
sched_unlock();
|
||||
spin_unlock_irqrestore_nopreempt(&config->lock, flags);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2469,25 +2467,25 @@ static void hciuart_pm_notify(struct pm_callback_s *cb, int domain,
|
||||
{
|
||||
switch (pmstate)
|
||||
{
|
||||
case(PM_NORMAL):
|
||||
case (PM_NORMAL):
|
||||
{
|
||||
/* Logic for PM_NORMAL goes here */
|
||||
}
|
||||
break;
|
||||
|
||||
case(PM_IDLE):
|
||||
case (PM_IDLE):
|
||||
{
|
||||
/* Logic for PM_IDLE goes here */
|
||||
}
|
||||
break;
|
||||
|
||||
case(PM_STANDBY):
|
||||
case (PM_STANDBY):
|
||||
{
|
||||
/* Logic for PM_STANDBY goes here */
|
||||
}
|
||||
break;
|
||||
|
||||
case(PM_SLEEP):
|
||||
case (PM_SLEEP):
|
||||
{
|
||||
/* Logic for PM_SLEEP goes here */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user