2 paths in the domU console handling are now the same. So they can be
merged to make the code simpler.
Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Wei Liu <wei.liu2@citrix.com>
*kout = '\0';
spin_lock(&cd->pbuf_lock);
kcount = kin - kbuf;
- if ( c == '\n' )
- {
- cd->pbuf[cd->pbuf_idx] = '\0';
- guest_printk(cd, XENLOG_G_DEBUG "%s%s\n", cd->pbuf, kbuf);
- cd->pbuf_idx = 0;
- }
- else if ( cd->pbuf_idx + (kout - kbuf) < (DOMAIN_PBUF_SIZE - 1) )
+ if ( c != '\n' &&
+ (cd->pbuf_idx + (kout - kbuf) < (DOMAIN_PBUF_SIZE - 1)) )
{
/* buffer the output until a newline */
memcpy(cd->pbuf + cd->pbuf_idx, kbuf, kout - kbuf);