hujun260 commented on code in PR #15548: URL: https://github.com/apache/nuttx/pull/15548#discussion_r1915916408
########## arch/mips/src/pic32mx/pic32mx_usbdev.c: ########## @@ -4383,7 +4401,8 @@ void mips_usbuninitialize(void) struct pic32mx_usbdev_s *priv = &g_usbdev; irqstate_t flags; - flags = enter_critical_section(); + flags = spin_lock_irqsave(&g_usbdev.lock); Review Comment: Generally, we should avoid exposing global variables in multiple parts of the code, as it can affect the scalability and reusability of the code. If there are multiple usbdev instances in the future, it would require modifying a lot of code. -- 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]
