xiaoxiang781216 commented on a change in pull request #4702:
URL: https://github.com/apache/incubator-nuttx/pull/4702#discussion_r734555950



##########
File path: arch/arm/src/stm32/stm32_mpuinit.c
##########
@@ -78,6 +78,12 @@ void stm32_mpuinitialize(void)
 
   mpu_showtype();
 
+#if defined(CONFIG_MPU_RESET)
+  /* Reset MPU if enabled */
+
+  mpu_reset();

Review comment:
       In the mpu.h
   ```
   /****************************************************************************
    * Name: mpu_reset
    *
    * Description:
    *   Resets the MPU to disabled.
    *
    
****************************************************************************/
   
   #if defined(CONFIG_MPU_RESET)
   void mpu_reset(void);
   #else
   #  define mpu_reset() do { } while (0)
   #endif
   
   
   #if defined(CONFIG_ARM_MPU_EARLY_RESET)
   void mpu_early_reset(void);
   #else
   #  define mpu_early_reset() do { } while (0)
   #endif
   ````
   In the mpu.c
   ```
   /****************************************************************************
    * Name: mpu_reset
    *
    * Description:
    *   Resets the MPU to disabled.
    *
    
****************************************************************************/
   
   #if defined(CONFIG_MPU_RESET)
   void mpu_reset(void)
   {
     mpu_reset_internal();
   }
   #endif
   
   
   #if defined(CONFIG_ARM_MPU_EARLY_RESET)
   void mpu_early_reset(void)
   {
     mpu_reset_internal();
   }
   #endif
   ````
   So, the caller can directly call mpu_reset or mpu_early_reset without 
#ifdef/#endif.




-- 
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