You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/04/27 12:53:01 UTC

[incubator-nuttx] branch master updated (daedc1f -> ac55fab)

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

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


    from daedc1f  openamp: Download libmetal and open-amp from github
     new 67b10fe  syslog/rpmsg: Fix warning: ‘syslog_rpmsg_write’ defined but not used
     new ac55fab  syslog: Check sc_flush in't NULL before invocation

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 drivers/syslog/syslog_channel.c     | 15 +++--------
 drivers/syslog/syslog_flush.c       |  8 ++++--
 drivers/syslog/syslog_rpmsg.c       | 52 ++++++++++++++++++-------------------
 include/nuttx/syslog/syslog_rpmsg.h |  3 +++
 4 files changed, 37 insertions(+), 41 deletions(-)


[incubator-nuttx] 02/02: syslog: Check sc_flush in't NULL before invocation

Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit ac55fab44d514355334e95dc18cbe5d3a3b2e0f6
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Mon Apr 27 12:23:42 2020 +0800

    syslog: Check sc_flush in't NULL before invocation
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 drivers/syslog/syslog_channel.c | 12 +-----------
 drivers/syslog/syslog_flush.c   |  8 ++++++--
 2 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/drivers/syslog/syslog_channel.c b/drivers/syslog/syslog_channel.c
index c731aae..2a8fd1c 100644
--- a/drivers/syslog/syslog_channel.c
+++ b/drivers/syslog/syslog_channel.c
@@ -72,7 +72,6 @@
 #ifdef NEED_LOWPUTC
 static int syslog_default_putc(int ch);
 #endif
-static int syslog_default_flush(void);
 
 /****************************************************************************
  * Public Data
@@ -83,7 +82,6 @@ static const struct syslog_channel_s g_default_channel =
 {
   ramlog_putc,
   ramlog_putc,
-  syslog_default_flush
 };
 #elif defined(CONFIG_SYSLOG_RPMSG)
 static const struct syslog_channel_s g_default_channel =
@@ -98,14 +96,12 @@ static const struct syslog_channel_s g_default_channel =
 {
   up_putc,
   up_putc,
-  syslog_default_flush
 };
 #else
 static const struct syslog_channel_s g_default_channel =
 {
   syslog_default_putc,
   syslog_default_putc,
-  syslog_default_flush
 };
 #endif
 
@@ -132,11 +128,6 @@ static int syslog_default_putc(int ch)
 }
 #endif
 
-static int syslog_default_flush(void)
-{
-  return OK;
-}
-
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
@@ -163,8 +154,7 @@ int syslog_channel(FAR const struct syslog_channel_s *channel)
 
   if (channel != NULL)
     {
-      DEBUGASSERT(channel->sc_putc != NULL && channel->sc_force != NULL &&
-                  channel->sc_flush != NULL);
+      DEBUGASSERT(channel->sc_putc != NULL && channel->sc_force != NULL);
 
       g_syslog_channel = channel;
       return OK;
diff --git a/drivers/syslog/syslog_flush.c b/drivers/syslog/syslog_flush.c
index 24e6f49..89e874f 100644
--- a/drivers/syslog/syslog_flush.c
+++ b/drivers/syslog/syslog_flush.c
@@ -91,6 +91,10 @@ int syslog_flush(void)
 
   /* Then flush all of the buffered output to the SYSLOG device */
 
-  DEBUGASSERT(g_syslog_channel->sc_flush != NULL);
-  return g_syslog_channel->sc_flush();
+  if (g_syslog_channel->sc_flush != NULL)
+    {
+      return g_syslog_channel->sc_flush();
+    }
+
+  return OK;
 }


[incubator-nuttx] 01/02: syslog/rpmsg: Fix warning: ‘syslog_rpmsg_write’ defined but not used

Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 67b10fea09cd4b4757aec33481bc69236fc9422b
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Mon Apr 27 12:15:11 2020 +0800

    syslog/rpmsg: Fix warning: ‘syslog_rpmsg_write’ defined but not used
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 drivers/syslog/syslog_channel.c     |  3 ++-
 drivers/syslog/syslog_rpmsg.c       | 52 ++++++++++++++++++-------------------
 include/nuttx/syslog/syslog_rpmsg.h |  3 +++
 3 files changed, 30 insertions(+), 28 deletions(-)

diff --git a/drivers/syslog/syslog_channel.c b/drivers/syslog/syslog_channel.c
index 381c02b..c731aae 100644
--- a/drivers/syslog/syslog_channel.c
+++ b/drivers/syslog/syslog_channel.c
@@ -90,7 +90,8 @@ static const struct syslog_channel_s g_default_channel =
 {
   syslog_rpmsg_putc,
   syslog_rpmsg_putc,
-  syslog_default_flush
+  syslog_rpmsg_flush,
+  syslog_rpmsg_write
 };
 #elif defined(HAVE_LOWPUTC)
 static const struct syslog_channel_s g_default_channel =
diff --git a/drivers/syslog/syslog_rpmsg.c b/drivers/syslog/syslog_rpmsg.c
index cec7f30..2d325f1 100644
--- a/drivers/syslog/syslog_rpmsg.c
+++ b/drivers/syslog/syslog_rpmsg.c
@@ -90,8 +90,6 @@ struct syslog_rpmsg_s
 static void syslog_rpmsg_work(FAR void *priv_);
 static void syslog_rpmsg_putchar(FAR struct syslog_rpmsg_s *priv, int ch,
                                  bool last);
-static int  syslog_rpmsg_flush(void);
-static ssize_t syslog_rpmsg_write(FAR const char *buffer, size_t buflen);
 static void syslog_rpmsg_device_created(FAR struct rpmsg_device *rdev,
                                         FAR void *priv_);
 static void syslog_rpmsg_device_destroy(FAR struct rpmsg_device *rdev,
@@ -220,31 +218,6 @@ static void syslog_rpmsg_putchar(FAR struct syslog_rpmsg_s *priv, int ch,
     }
 }
 
-static int syslog_rpmsg_flush(void)
-{
-  FAR struct syslog_rpmsg_s *priv = &g_syslog_rpmsg;
-
-  work_queue(HPWORK, &priv->work, syslog_rpmsg_work, priv, 0);
-  return OK;
-}
-
-static ssize_t syslog_rpmsg_write(FAR const char *buffer, size_t buflen)
-{
-  FAR struct syslog_rpmsg_s *priv = &g_syslog_rpmsg;
-  irqstate_t flags;
-  size_t nwritten;
-
-  flags = enter_critical_section();
-  for (nwritten = 1; nwritten <= buflen; nwritten++)
-    {
-      syslog_rpmsg_putchar(priv, *buffer++, nwritten == buflen);
-    }
-
-  leave_critical_section(flags);
-
-  return buflen;
-}
-
 static void syslog_rpmsg_device_created(FAR struct rpmsg_device *rdev,
                                         FAR void *priv_)
 {
@@ -352,6 +325,31 @@ int syslog_rpmsg_putc(int ch)
   return ch;
 }
 
+int syslog_rpmsg_flush(void)
+{
+  FAR struct syslog_rpmsg_s *priv = &g_syslog_rpmsg;
+
+  work_queue(HPWORK, &priv->work, syslog_rpmsg_work, priv, 0);
+  return OK;
+}
+
+ssize_t syslog_rpmsg_write(FAR const char *buffer, size_t buflen)
+{
+  FAR struct syslog_rpmsg_s *priv = &g_syslog_rpmsg;
+  irqstate_t flags;
+  size_t nwritten;
+
+  flags = enter_critical_section();
+  for (nwritten = 1; nwritten <= buflen; nwritten++)
+    {
+      syslog_rpmsg_putchar(priv, *buffer++, nwritten == buflen);
+    }
+
+  leave_critical_section(flags);
+
+  return buflen;
+}
+
 void syslog_rpmsg_init_early(FAR const char *cpuname, FAR void *buffer,
                              size_t size)
 {
diff --git a/include/nuttx/syslog/syslog_rpmsg.h b/include/nuttx/syslog/syslog_rpmsg.h
index ac762f6..7d0910c 100644
--- a/include/nuttx/syslog/syslog_rpmsg.h
+++ b/include/nuttx/syslog/syslog_rpmsg.h
@@ -59,7 +59,10 @@ extern "C"
 void syslog_rpmsg_init_early(FAR const char *cpu_name, FAR void *buffer,
                              size_t size);
 int syslog_rpmsg_init(void);
+
 int syslog_rpmsg_putc(int ch);
+int syslog_rpmsg_flush(void);
+ssize_t syslog_rpmsg_write(FAR const char *buffer, size_t buflen);
 #endif
 
 #ifdef CONFIG_SYSLOG_RPMSG_SERVER