From c0f7dd979e68a7fc223bc5645bc94bcf9bcec4c9 Mon Sep 17 00:00:00 2001 From: hujun5 Date: Thu, 26 Dec 2024 21:27:59 +0800 Subject: [PATCH] fix compile error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CC: pthread/pthread_exit.c common/espressif/esp_lowputc.c: In function 'esp_lowputc_disable_all_uart_int': common/espressif/esp_lowputc.c:215:29: error: passing argument 1 of 'spin_lock_irqsave' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] 215 | flags = spin_lock_irqsave(&priv->lock); | ^~~~~~~~~~~ In file included from common/espressif/esp_lowputc.c:40: /home/hujun5/下载/vela_sim/nuttx/include/nuttx/spinlock.h:511:55: note: expected 'volatile spinlock_t *' {aka 'volatile unsigned int *'} but argument is of type 'const spinlock_t *' {aka 'const unsigned int *'} 511 | irqstate_t spin_lock_irqsave(FAR volatile spinlock_t *lock) | ~~~~~~~~~~~~~~~~~~~~~^~~~ common/espressif/esp_lowputc.c:232:26: error: passing argument 1 of 'spin_unlock_irqrestore' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] 232 | spin_unlock_irqrestore(&priv->lock, flags); | ^~~~~~~~~~~ /home/hujun5/下载/vela_sim/nuttx/include/nuttx/spinlock.h:674:54: note: expected 'volatile spinlock_t *' {aka 'volatile unsigned int *'} but argument is of type 'const spinlock_t *' {aka 'const unsigned int *'} 674 | void spin_unlock_irqrestore(FAR volatile spinlock_t *lock, Signed-off-by: hujun5 --- arch/risc-v/src/common/espressif/esp_lowputc.c | 2 +- arch/risc-v/src/common/espressif/esp_lowputc.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/risc-v/src/common/espressif/esp_lowputc.c b/arch/risc-v/src/common/espressif/esp_lowputc.c index 29296569cb..c78344f06d 100644 --- a/arch/risc-v/src/common/espressif/esp_lowputc.c +++ b/arch/risc-v/src/common/espressif/esp_lowputc.c @@ -207,7 +207,7 @@ void esp_lowputc_enable_sysclk(const struct esp_uart_s *priv) * ****************************************************************************/ -void esp_lowputc_disable_all_uart_int(const struct esp_uart_s *priv, +void esp_lowputc_disable_all_uart_int(struct esp_uart_s *priv, uint32_t *current_status) { irqstate_t flags; diff --git a/arch/risc-v/src/common/espressif/esp_lowputc.h b/arch/risc-v/src/common/espressif/esp_lowputc.h index a0f9cf215b..f3cd24b228 100644 --- a/arch/risc-v/src/common/espressif/esp_lowputc.h +++ b/arch/risc-v/src/common/espressif/esp_lowputc.h @@ -129,7 +129,7 @@ void esp_lowputc_enable_sysclk(const struct esp_uart_s *priv); * ****************************************************************************/ -void esp_lowputc_disable_all_uart_int(const struct esp_uart_s *priv, +void esp_lowputc_disable_all_uart_int(struct esp_uart_s *priv, uint32_t *current_status); /****************************************************************************