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:02 UTC
[incubator-nuttx] 01/02: syslog/rpmsg: Fix warning: ‘syslog_rpmsg_write’ defined but not used
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