This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch releases/10.2
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 55718fb23f4b06314ae09be4761f7a60cc4e6025
Author: Abdelatif Guettouche <abdelatif.guettou...@espressif.com>
AuthorDate: Wed Oct 13 12:44:53 2021 +0200

    esp32_spiflash.c: Allocate only one variable to hold the cache state in
    single CPU mode.
    
    Signed-off-by: Abdelatif Guettouche <abdelatif.guettou...@espressif.com>
---
 arch/xtensa/src/esp32/esp32_spiflash.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/xtensa/src/esp32/esp32_spiflash.c 
b/arch/xtensa/src/esp32/esp32_spiflash.c
index 5060473..7c085ab 100644
--- a/arch/xtensa/src/esp32/esp32_spiflash.c
+++ b/arch/xtensa/src/esp32/esp32_spiflash.c
@@ -59,6 +59,12 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
+/* Used in spiflash_cachestate_s structure even when SMP is disabled. */
+
+#ifndef CONFIG_SMP_NCPUS
+#  define CONFIG_SMP_NCPUS 1
+#endif
+
 #define SPI_FLASH_WRITE_BUF_SIZE    (32)
 #define SPI_FLASH_READ_BUF_SIZE     (64)
 
@@ -165,7 +171,7 @@ struct spiflash_cachestate_s
   int other;
 #endif
   irqstate_t flags;
-  uint32_t val[2];
+  uint32_t val[CONFIG_SMP_NCPUS];
 };
 
 /****************************************************************************

Reply via email to