common/uart_buffering.c: Format with clang-format
BRANCH=none
TEST=none
@@ -37,12 +37,12 @@ BUILD_ASSERT((CONFIG_UART_RX_BUF_SIZE & (CONFIG_UART_RX_BUF_SIZE - 1)) == 0);
* of input has been detected by the normal tick task. There will be
* CONFIG_UART_RX_DMA_RECHECKS rechecks between this tick and the next tick.
*/
-#define RX_DMA_RECHECK_INTERVAL (HOOK_TICK_INTERVAL / \
- (CONFIG_UART_RX_DMA_RECHECKS + 1))
+#define RX_DMA_RECHECK_INTERVAL \
+ (HOOK_TICK_INTERVAL / (CONFIG_UART_RX_DMA_RECHECKS + 1))
/* Transmit and receive buffers */
-static volatile char tx_buf[CONFIG_UART_TX_BUF_SIZE]
- __uncached __preserved_logs(tx_buf);
+static volatile char tx_buf[CONFIG_UART_TX_BUF_SIZE] __uncached
+ __preserved_logs(tx_buf);
static volatile int tx_buf_head __preserved_logs(tx_buf_head);
static volatile int tx_buf_tail __preserved_logs(tx_buf_tail);
static volatile char rx_buf[CONFIG_UART_RX_BUF_SIZE] __uncached;
@@ -59,7 +59,6 @@ static int uart_buffer_calc_checksum(void)
return tx_buf_head ^ tx_buf_tail;
}
-
void uart_init_buffer(void)
{
if (tx_checksum != uart_buffer_calc_checksum() ||
@@ -154,8 +153,9 @@ void uart_process_output(void)
* Get the largest contiguous block of output. If the transmit buffer
* wraps, only use the part before the wrap.
*/
- tx_dma_in_progress = (head > tx_buf_tail ? head :
- CONFIG_UART_TX_BUF_SIZE) - tx_buf_tail;
+ tx_dma_in_progress =
+ (head > tx_buf_tail ? head : CONFIG_UART_TX_BUF_SIZE) -
+ tx_buf_tail;
uart_tx_dma_start((char *)(tx_buf + tx_buf_tail), tx_dma_in_progress);
}
@@ -347,9 +347,7 @@ enum ec_status uart_console_read_buffer_init(void)
return EC_RES_SUCCESS;
}
-int uart_console_read_buffer(uint8_t type,
- char *dest,
- uint16_t dest_size,
+int uart_console_read_buffer(uint8_t type, char *dest, uint16_t dest_size,
uint16_t *write_count)
{
int *tail;
@@ -371,7 +369,6 @@ int uart_console_read_buffer(uint8_t type,
/* Copy data to response */
while (*tail != tx_snapshot_head && *write_count < dest_size - 1) {
-
/*
* Copy only non-zero bytes, so that we don't copy unused
* bytes if the buffer hasn't completely rolled at boot.
