ramlog: Remove RAMLOG_CRLF config and related code

since the conversion is moved to common layer after:
https://github.com/apache/nuttx/pull/14362

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2024-10-21 12:18:43 +08:00 committed by archer
parent 317d7a7f59
commit 8c882cb790
2 changed files with 1 additions and 41 deletions

View File

@ -77,13 +77,6 @@ config RAMLOG
details as needed to support logging. details as needed to support logging.
if RAMLOG if RAMLOG
config RAMLOG_CRLF
bool "RAMLOG CR/LF"
default n
---help---
Pre-pend a carriage return before every linefeed that goes into the
RAM log.
config RAMLOG_NONBLOCKING config RAMLOG_NONBLOCKING
bool "RAMLOG non-block reads" bool "RAMLOG non-block reads"
default y default y

View File

@ -289,16 +289,11 @@ static void ramlog_copybuf(FAR struct ramlog_dev_s *priv,
static ssize_t ramlog_addbuf(FAR struct ramlog_dev_s *priv, static ssize_t ramlog_addbuf(FAR struct ramlog_dev_s *priv,
FAR const char *buffer, size_t len) FAR const char *buffer, size_t len)
{ {
#if defined(CONFIG_RAMLOG_SYSLOG) || defined(CONFIG_RAMLOG_CRLF) #ifdef CONFIG_RAMLOG_SYSLOG
FAR struct ramlog_header_s *header = priv->rl_header; FAR struct ramlog_header_s *header = priv->rl_header;
#endif #endif
size_t buflen = len; size_t buflen = len;
irqstate_t flags; irqstate_t flags;
#ifdef CONFIG_RAMLOG_CRLF
FAR const char *end;
FAR const char *pos;
FAR char *buf;
#endif
/* Disable interrupts (in case we are NOT called from interrupt handler) */ /* Disable interrupts (in case we are NOT called from interrupt handler) */
@ -318,35 +313,7 @@ static ssize_t ramlog_addbuf(FAR struct ramlog_dev_s *priv,
buflen = priv->rl_bufsize; buflen = priv->rl_bufsize;
} }
#ifdef CONFIG_RAMLOG_CRLF
buf = header->rl_buffer;
end = buffer + buflen;
pos = buffer;
do
{
/* Ignore carriage returns */
if (*pos == '\r' || *pos == '\n')
{
ramlog_copybuf(priv, buffer, pos - buffer);
buffer = pos + 1;
}
/* Pre-pend a carriage before a linefeed */
if (*pos == '\n')
{
buf[header->rl_head++ % priv->rl_bufsize] = '\r';
buf[header->rl_head++ % priv->rl_bufsize] = '\n';
}
}
while (++pos != end);
ramlog_copybuf(priv, buffer, pos - buffer);
#else
ramlog_copybuf(priv, buffer, buflen); ramlog_copybuf(priv, buffer, buflen);
#endif
/* Was anything written? */ /* Was anything written? */