From 4c54ceb24a333a5626e21340e7c8ccfd6fa51070 Mon Sep 17 00:00:00 2001 From: Juan Carrano <j.carrano@fu-berlin.de> Date: Wed, 17 Oct 2018 16:54:12 +0200 Subject: [PATCH] drivers/ethos: remove unnecessary casts. The code contained superfluous casts which did not preserve the const qualifiers. Functionality is unchanged, but there are no more warnings reported by -Wcast-qual for this module. --- drivers/ethos/ethos.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/ethos/ethos.c b/drivers/ethos/ethos.c index cecec42545..6359a95d96 100644 --- a/drivers/ethos/ethos.c +++ b/drivers/ethos/ethos.c @@ -200,16 +200,16 @@ static size_t iolist_count_total(const iolist_t *iolist) static void _write_escaped(uart_t uart, uint8_t c) { - uint8_t *out; + const uint8_t *out; int n; switch(c) { case ETHOS_FRAME_DELIMITER: - out = (uint8_t*)_esc_delim; + out = _esc_delim; n = 2; break; case ETHOS_ESC_CHAR: - out = (uint8_t*)_esc_esc; + out = _esc_esc; n = 2; break; default: @@ -244,7 +244,7 @@ void ethos_send_frame(ethos_t *dev, const uint8_t *data, size_t len, unsigned fr /* send frame content */ while(len--) { - _write_escaped(dev->uart, *(uint8_t*)data++); + _write_escaped(dev->uart, *data++); } /* end of frame */ -- GitLab