Skip to content

Commit 2c62291

Browse files
etienne-lmskartben
authored andcommitted
drivers: spi: stm32: fix missing braces in conditioned instruction
Fix a missing braces pair around a conditioned instruction in STM32 SPI driver. Fix that by aggregating the 2 if() instructions into a single ANDed one. Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
1 parent 21dd1db commit 2c62291

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/spi/spi_ll_stm32.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -779,9 +779,9 @@ static int spi_stm32_configure(const struct device *dev,
779779

780780
if (spi_cs_is_gpio(config) || !IS_ENABLED(CONFIG_SPI_STM32_USE_HW_SS)) {
781781
#if DT_HAS_COMPAT_STATUS_OKAY(st_stm32h7_spi)
782-
if (SPI_OP_MODE_GET(config->operation) == SPI_OP_MODE_MASTER) {
783-
if (LL_SPI_GetNSSPolarity(spi) == LL_SPI_NSS_POLARITY_LOW)
784-
LL_SPI_SetInternalSSLevel(spi, LL_SPI_SS_LEVEL_HIGH);
782+
if ((SPI_OP_MODE_GET(config->operation) == SPI_OP_MODE_MASTER) &&
783+
(LL_SPI_GetNSSPolarity(spi) == LL_SPI_NSS_POLARITY_LOW)) {
784+
LL_SPI_SetInternalSSLevel(spi, LL_SPI_SS_LEVEL_HIGH);
785785
}
786786
#endif
787787
LL_SPI_SetNSSMode(spi, LL_SPI_NSS_SOFT);

0 commit comments

Comments
 (0)