From 595fbf9b975103eede31c2b5c68a392517f252f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Thu, 17 Nov 2022 18:00:37 +0100 Subject: [PATCH] drivers: uart_nrfx_uarte: Remove redundant HW_RX_COUNTING_ENABLED calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge three adjacent `if (HW_RX_COUNTING_ENABLED(data))` blocks into a common one. Signed-off-by: Andrzej Głąbek --- drivers/serial/uart_nrfx_uarte.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 13ecd313426..e0026bfa006 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -662,9 +662,7 @@ static int uarte_nrfx_rx_counting_init(const struct device *dev) nrfx_timer_enable(&cfg->timer); nrfx_timer_clear(&cfg->timer); } - } - if (HW_RX_COUNTING_ENABLED(data)) { ret = gppi_channel_alloc(&data->async->rx_cnt.ppi); if (ret != NRFX_SUCCESS) { LOG_ERR("Failed to allocate PPI Channel, " @@ -672,9 +670,7 @@ static int uarte_nrfx_rx_counting_init(const struct device *dev) data->async->hw_rx_counting = false; nrfx_timer_uninit(&cfg->timer); } - } - if (HW_RX_COUNTING_ENABLED(data)) { #if CONFIG_HAS_HW_NRF_PPI ret = nrfx_ppi_channel_assign( data->async->rx_cnt.ppi,