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

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


The following commit(s) were added to refs/heads/master by this push:
     new 2262ddf  arch: Remove fflush(stdout) from driver code
2262ddf is described below

commit 2262ddfa6d693496b99fb2eb478689667e500a74
Author: Xiang Xiao <xiaoxi...@xiaomi.com>
AuthorDate: Mon Nov 15 03:29:03 2021 +0800

    arch: Remove fflush(stdout) from driver code
    
    it's wrong to call stdio function inside driver
    
    Signed-off-by: Xiang Xiao <xiaoxi...@xiaomi.com>
---
 arch/arm/src/lc823450/lc823450_mtd.c | 2 --
 arch/risc-v/src/esp32c3/esp32c3_pm.c | 2 --
 arch/xtensa/src/esp32/esp32_pm.c     | 2 --
 3 files changed, 6 deletions(-)

diff --git a/arch/arm/src/lc823450/lc823450_mtd.c 
b/arch/arm/src/lc823450/lc823450_mtd.c
index b3195a7..b9f9282 100644
--- a/arch/arm/src/lc823450/lc823450_mtd.c
+++ b/arch/arm/src/lc823450/lc823450_mtd.c
@@ -645,7 +645,6 @@ int lc823450_mtd_initialize(uint32_t devno)
 
 #ifdef CONFIG_DEBUG
   finfo("/dev/mtdblock%d created\n", devno);
-  fflush(stdout);
 #endif
 
   priv = (FAR struct lc823450_mtd_dev_s *)g_mtdmaster[ch];
@@ -845,7 +844,6 @@ int lc823450_mtd_uninitialize(uint32_t devno)
 
 #ifdef CONFIG_DEBUG
   finfo("/dev/mtdblock%d deleted\n", devno);
-  fflush(stdout);
 #endif
   return OK;
 }
diff --git a/arch/risc-v/src/esp32c3/esp32c3_pm.c 
b/arch/risc-v/src/esp32c3/esp32c3_pm.c
index a9ee3c0..ab08d4f 100644
--- a/arch/risc-v/src/esp32c3/esp32c3_pm.c
+++ b/arch/risc-v/src/esp32c3/esp32c3_pm.c
@@ -1579,7 +1579,6 @@ void esp32c3_pmstandby(uint64_t time_in_us)
 
   /* don't power down XTAL — powering it up takes different time on. */
 
-  fflush(stdout);
   esp32c3_sleep_enable_rtc_timer_wakeup(time_in_us);
 #ifdef CONFIG_ESP32C3_RT_TIMER
   /* Get rt-timer timestamp before entering sleep */
@@ -1665,7 +1664,6 @@ void IRAM_ATTR esp32c3_deep_sleep_start(void)
 
 void esp32c3_pmsleep(uint64_t time_in_us)
 {
-  fflush(stdout);
   esp32c3_sleep_enable_rtc_timer_wakeup(time_in_us);
   esp32c3_deep_sleep_start();
 }
diff --git a/arch/xtensa/src/esp32/esp32_pm.c b/arch/xtensa/src/esp32/esp32_pm.c
index 127302b..b0cc20d 100644
--- a/arch/xtensa/src/esp32/esp32_pm.c
+++ b/arch/xtensa/src/esp32/esp32_pm.c
@@ -975,7 +975,6 @@ void esp32_pmstandby(uint64_t time_in_us)
 
   /* don't power down XTAL — powering it up takes different time on. */
 
-  fflush(stdout);
   esp32_sleep_enable_timer_wakeup(time_in_us);
 
 #ifdef CONFIG_ESP32_RT_TIMER
@@ -1128,7 +1127,6 @@ void esp32_deep_sleep_start(void)
 
 void esp32_pmsleep(uint64_t time_in_us)
 {
-  fflush(stdout);
   esp32_sleep_enable_timer_wakeup(time_in_us);
   esp32_deep_sleep_start();
 }

Reply via email to