Skip to content

Commit a9b3c93

Browse files
finikorgcarlescufi
authored andcommitted
shell: uart: Fix compilation warning
Use ARG_UNUSED() to fix compilation warning unused-but-set-variable. Signed-off-by: Andrei Emeltchenko <[email protected]>
1 parent 29128bf commit a9b3c93

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

subsys/shell/backends/shell_uart.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,19 @@ static void uart_tx_handle(const struct device *dev,
124124
const struct shell_uart *sh_uart)
125125
{
126126
uint32_t len;
127-
int err;
128127
const uint8_t *data;
129128

130129
len = ring_buf_get_claim(sh_uart->tx_ringbuf, (uint8_t **)&data,
131130
sh_uart->tx_ringbuf->size);
132131
if (len) {
132+
int err;
133+
133134
/* Wait for DTR signal before sending anything to output. */
134135
uart_dtr_wait(dev);
135136
len = uart_fifo_fill(dev, data, len);
136137
err = ring_buf_get_finish(sh_uart->tx_ringbuf, len);
137138
__ASSERT_NO_MSG(err == 0);
139+
ARG_UNUSED(err);
138140
} else {
139141
uart_irq_tx_disable(dev);
140142
sh_uart->ctrl_blk->tx_busy = 0;

0 commit comments

Comments
 (0)