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

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

commit fbf0a88e6386e19009fb6fa9cc465069ab383b27
Author: Bowen Wang <[email protected]>
AuthorDate: Mon May 25 16:20:06 2026 +0800

    drivers/rptun: drop the SYSLOG_RPMSG_SERVER guards around the dump
    
    syslog_rpmsg_dump() is a static inline function in syslog_rpmsg.h that
    does not depend on CONFIG_SYSLOG_RPMSG_SERVER, so the guards around
    rptun_dev_dump(), the RPTUNIOC_DUMP case and the dump on SYS_HALT only
    make RPTUNIOC_DUMP fail with -ENOTTY. Keep the guard inside
    rptun_dev_dump() only.
    
    Signed-off-by: Bowen Wang <[email protected]>
---
 drivers/rptun/rptun.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/rptun/rptun.c b/drivers/rptun/rptun.c
index 408581f56a2..f9ff8a2db69 100644
--- a/drivers/rptun/rptun.c
+++ b/drivers/rptun/rptun.c
@@ -1369,16 +1369,16 @@ static int rptun_dev_reset(FAR struct rptun_priv_s 
*priv, unsigned long val)
   return ret;
 }
 
-#ifdef CONFIG_SYSLOG_RPMSG_SERVER
 static void rptun_dev_dump(FAR struct rptun_priv_s *priv)
 {
+#ifdef CONFIG_SYSLOG_RPMSG_SERVER
   if (priv->trace_va != NULL)
     {
       _emerg("Dump %s's trace\n", RPTUN_GET_CPUNAME(priv->dev));
       syslog_rpmsg_dump(priv->trace_va);
     }
-}
 #endif
+}
 
 static int rptun_do_ioctl(FAR struct rptun_priv_s *priv, int cmd,
                           unsigned long arg)
@@ -1407,11 +1407,9 @@ static int rptun_do_ioctl(FAR struct rptun_priv_s *priv, 
int cmd,
       case RPTUNIOC_RESET:
         ret = rptun_dev_reset(priv, arg);
         break;
-#ifdef CONFIG_SYSLOG_RPMSG_SERVER
       case RPTUNIOC_DUMP:
         rptun_dev_dump(priv);
         break;
-#endif
       default:
         ret = -ENOTTY;
         break;
@@ -1688,12 +1686,10 @@ static int rptun_notifier(FAR struct notifier_block 
*block,
 
       rptun_ioctl_foreach(NULL, RPTUNIOC_RESET, val);
 
-#ifdef CONFIG_SYSLOG_RPMSG_SERVER
       if (action == SYS_HALT)
         {
           rptun_ioctl_foreach(NULL, RPTUNIOC_DUMP, 0);
         }
-#endif
     }
   else if (action == PANIC_KERNEL)
     {

Reply via email to