third_party: minor formatting cleanups

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2019-02-28 10:48:47 +08:00
parent fae65117cd
commit 1048cbf999
2 changed files with 8 additions and 7 deletions

View File

@ -53,8 +53,8 @@ char uart_read(void)
{ {
char c; char c;
if(irq_getie()) { if (irq_getie()) {
while(rx_consume == rx_produce); while (rx_consume == rx_produce);
} else if (rx_consume == rx_produce) { } else if (rx_consume == rx_produce) {
return 0; return 0;
} }
@ -74,7 +74,7 @@ void uart_write(char c)
unsigned int oldmask; unsigned int oldmask;
unsigned int tx_produce_next = (tx_produce + 1) & UART_RINGBUFFER_MASK_TX; unsigned int tx_produce_next = (tx_produce + 1) & UART_RINGBUFFER_MASK_TX;
if(irq_getie()) { if (irq_getie()) {
while(tx_produce_next == tx_consume); while(tx_produce_next == tx_consume);
} else if(tx_produce_next == tx_consume) { } else if(tx_produce_next == tx_consume) {
return; return;
@ -82,7 +82,7 @@ void uart_write(char c)
oldmask = irq_getmask(); oldmask = irq_getmask();
irq_setmask(oldmask & ~(1 << UART_INTERRUPT)); irq_setmask(oldmask & ~(1 << UART_INTERRUPT));
if((tx_consume != tx_produce) || uart_txfull_read()) { if ((tx_consume != tx_produce) || uart_txfull_read()) {
tx_buf[tx_produce] = c; tx_buf[tx_produce] = c;
tx_produce = tx_produce_next; tx_produce = tx_produce_next;
} else { } else {

View File

@ -255,8 +255,9 @@ void tfp_sprintf(char *s, char *fmt, ...)
va_end(va); va_end(va);
} }
int puts(const char *s) { int puts(const char *s) {
while (*s++) while (*s++)
stdout_putf(stdout_putp, *s); stdout_putf(stdout_putp, *s);
stdout_putf(stdout_putp, '\n'); stdout_putf(stdout_putp, '\n');
} return 1;
}