syslog: remove unsed check

To simplify the code

Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd 2023-04-25 11:48:30 +08:00 committed by GUIDINGLI
parent 904ca21a00
commit b743d62703
2 changed files with 4 additions and 2 deletions

View File

@ -275,7 +275,7 @@ static void ramlog_initbuf(void)
prev = cur;
}
if (i != priv->rl_bufsize || is_empty)
if (is_empty)
{
priv->rl_head = priv->rl_tail = 0;
}

View File

@ -392,6 +392,7 @@ void syslog_rpmsg_init_early(FAR void *buffer, size_t size)
struct boardioc_reset_cause_s cause;
int ret;
#endif
bool is_empty = true;
char prev;
char cur;
size_t i;
@ -425,6 +426,7 @@ void syslog_rpmsg_init_early(FAR void *buffer, size_t size)
else if (prev && !cur)
{
priv->head = i;
is_empty = false;
}
else if (!prev && cur)
{
@ -434,7 +436,7 @@ void syslog_rpmsg_init_early(FAR void *buffer, size_t size)
prev = cur;
}
if (i != size)
if (is_empty)
{
priv->head = priv->tail = 0;
}