From d533ae6375be36af1a0c317e359509aea9acf718 Mon Sep 17 00:00:00 2001 From: "Sergio R. Caprile" Date: Mon, 26 Oct 2020 19:33:29 -0300 Subject: [PATCH] Fixed style issues Signed-off-by: Sergio R. Caprile --- src/esp32/esp32_spi_master.c | 8 ++------ src/stm32/stm32_spi_master_gspi.c | 4 +--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/esp32/esp32_spi_master.c b/src/esp32/esp32_spi_master.c index 47fe2fd..e19f2f8 100644 --- a/src/esp32/esp32_spi_master.c +++ b/src/esp32/esp32_spi_master.c @@ -264,9 +264,7 @@ static void esp32_spi_get_rx_data(spi_dev_t *dev, uint8_t *data, size_t skip, if (skip > 0) { skip--; } else { - if (NULL != data) { - data[i] = byte; - } + if (data != NULL) data[i] = byte; ++i; } w >>= 8; @@ -317,9 +315,7 @@ static bool mgos_spi_run_txn_fd(struct mgos_spi *c, const void *tx_data, } esp32_spi_get_rx_data(dev, rxdp, 0, dlen); txdp += dlen; - if (NULL != rxdp) { - rxdp += dlen; - } + if (rxdp != NULL) rxdp += dlen; } return true; diff --git a/src/stm32/stm32_spi_master_gspi.c b/src/stm32/stm32_spi_master_gspi.c index 60de885..5519944 100644 --- a/src/stm32/stm32_spi_master_gspi.c +++ b/src/stm32/stm32_spi_master_gspi.c @@ -129,9 +129,7 @@ bool stm32_gspi_run_txn_fd(struct mgos_spi *c, const struct mgos_spi_txn *txn) { if (c->debug) { LOG(LL_DEBUG, ("read 0x%02x", byte)); } - if(!discard_rx) { - *rx_data++ = byte; - } + if (!discard_rx) *rx_data++ = byte; } len--; }