Skip to content

Commit

Permalink
syslog/rpmsg_server: fix build break if enable SYSLOG_RPMSG/SYSLOG_RP…
Browse files Browse the repository at this point in the history
…MSG_SERVER

syslog/syslog_rpmsg_server.c:66:13: error: conflicting types for 'syslog_rpmsg_write';
      have 'void(const char *, size_t,  const char *, size_t)' {aka 'void(const char *, unsigned int,  const char *, unsigned int)'}
   66 | static void syslog_rpmsg_write(FAR const char *buf1, size_t len1,
      |             ^~~~~~~~~~~~~~~~~~
In file included from syslog/syslog_rpmsg_server.c:36:
nuttx/include/nuttx/syslog/syslog_rpmsg.h:51:9: note: previous declaration of
  'syslog_rpmsg_write' with type 'ssize_t(const syslog_channel_t *, const char *, size_t)' {aka 'int(const struct syslog_channel_s *, const char *, unsigned int)'}
   51 | ssize_t syslog_rpmsg_write(FAR syslog_channel_t *channel,
      |         ^~~~~~~~~~~~~~~~~~

Signed-off-by: chao an <[email protected]>
  • Loading branch information
anchao authored and jerpelea committed Feb 25, 2025
1 parent 8b5a45c commit c782131
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions drivers/syslog/syslog_rpmsg_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ struct syslog_rpmsg_server_s
* Private Function Prototypes
****************************************************************************/

static void syslog_rpmsg_write(FAR const char *buf1, size_t len1,
FAR const char *buf2, size_t len2);
static void syslog_rpmsg_write_internal(FAR const char *buf1, size_t len1,
FAR const char *buf2, size_t len2);
static bool syslog_rpmsg_ns_match(FAR struct rpmsg_device *rdev,
FAR void *priv_, FAR const char *name,
uint32_t dest);
Expand Down Expand Up @@ -131,8 +131,9 @@ static int syslog_rpmsg_file_ioctl(FAR struct file *filep, int cmd,
}
#endif

static void syslog_rpmsg_write(FAR const char *buf1, size_t len1,
FAR const char *buf2, size_t len2)
static void
syslog_rpmsg_write_internal(FAR const char *buf1, size_t len1,
FAR const char *buf2, size_t len2)
{
FAR const char *nl;
size_t len;
Expand Down Expand Up @@ -178,7 +179,7 @@ static void syslog_rpmsg_ept_release(FAR struct rpmsg_endpoint *ept)

if (priv->nextpos)
{
syslog_rpmsg_write(priv->tmpbuf, priv->nextpos, "\n", 1);
syslog_rpmsg_write_internal(priv->tmpbuf, priv->nextpos, "\n", 1);
}

#ifdef CONFIG_SYSLOG_RPMSG_SERVER_CHARDEV
Expand Down Expand Up @@ -244,8 +245,9 @@ static int syslog_rpmsg_ept_cb(FAR struct rpmsg_endpoint *ept,

if (priv->nextpos)
{
syslog_rpmsg_write(priv->tmpbuf, priv->nextpos,
msg->data, printed);
syslog_rpmsg_write_internal(priv->tmpbuf,
priv->nextpos,
msg->data, printed);
priv->nextpos = 0;
}
else
Expand Down

0 comments on commit c782131

Please sign in to comment.