diff --git a/os/hal/ports/STM32/LLD/SPIv3/hal_spi_lld.c b/os/hal/ports/STM32/LLD/SPIv3/hal_spi_lld.c index dff76ac10..f04d37d8f 100644 --- a/os/hal/ports/STM32/LLD/SPIv3/hal_spi_lld.c +++ b/os/hal/ports/STM32/LLD/SPIv3/hal_spi_lld.c @@ -512,7 +512,7 @@ void spi_lld_start(SPIDriver *spip) { STM32_SPI_SPI1_IRQ_PRIORITY, (stm32_dmaisr_t)spi_lld_serve_dma_tx_interrupt, (void *)spip); - osalDbgAssert(spip->tx.dma!= NULL, "unable to allocate stream"); + osalDbgAssert(spip->tx.dma != NULL, "unable to allocate stream"); rccEnableSPI1(true); dmaSetRequestSource(spip->rx.dma, STM32_DMAMUX1_SPI1_RX); dmaSetRequestSource(spip->tx.dma, STM32_DMAMUX1_SPI1_TX); @@ -529,7 +529,7 @@ void spi_lld_start(SPIDriver *spip) { STM32_SPI_SPI2_IRQ_PRIORITY, (stm32_dmaisr_t)spi_lld_serve_dma_tx_interrupt, (void *)spip); - osalDbgAssert(spip->tx.dma!= NULL, "unable to allocate stream"); + osalDbgAssert(spip->tx.dma != NULL, "unable to allocate stream"); rccEnableSPI2(true); dmaSetRequestSource(spip->rx.dma, STM32_DMAMUX1_SPI2_RX); dmaSetRequestSource(spip->tx.dma, STM32_DMAMUX1_SPI2_TX); @@ -546,7 +546,7 @@ void spi_lld_start(SPIDriver *spip) { STM32_SPI_SPI3_IRQ_PRIORITY, (stm32_dmaisr_t)spi_lld_serve_dma_tx_interrupt, (void *)spip); - osalDbgAssert(spip->tx.dma!= NULL, "unable to allocate stream"); + osalDbgAssert(spip->tx.dma != NULL, "unable to allocate stream"); rccEnableSPI3(true); dmaSetRequestSource(spip->rx.dma, STM32_DMAMUX1_SPI3_RX); dmaSetRequestSource(spip->tx.dma, STM32_DMAMUX1_SPI3_TX); @@ -563,7 +563,7 @@ void spi_lld_start(SPIDriver *spip) { STM32_SPI_SPI4_IRQ_PRIORITY, (stm32_dmaisr_t)spi_lld_serve_dma_tx_interrupt, (void *)spip); - osalDbgAssert(spip->tx.dma!= NULL, "unable to allocate stream"); + osalDbgAssert(spip->tx.dma != NULL, "unable to allocate stream"); rccEnableSPI4(true); dmaSetRequestSource(spip->rx.dma, STM32_DMAMUX1_SPI4_RX); dmaSetRequestSource(spip->tx.dma, STM32_DMAMUX1_SPI4_TX); @@ -580,7 +580,7 @@ void spi_lld_start(SPIDriver *spip) { STM32_SPI_SPI5_IRQ_PRIORITY, (stm32_dmaisr_t)spi_lld_serve_dma_tx_interrupt, (void *)spip); - osalDbgAssert(spip->tx.dma!= NULL, "unable to allocate stream"); + osalDbgAssert(spip->tx.dma != NULL, "unable to allocate stream"); rccEnableSPI5(true); dmaSetRequestSource(spip->rx.dma, STM32_DMAMUX1_SPI5_RX); dmaSetRequestSource(spip->tx.dma, STM32_DMAMUX1_SPI5_TX); @@ -597,7 +597,7 @@ void spi_lld_start(SPIDriver *spip) { STM32_SPI_SPI6_IRQ_PRIORITY, (stm32_dmaisr_t)spi_lld_serve_bdma_tx_interrupt, (void *)spip); - osalDbgAssert(spip->tx.dma!= NULL, "unable to allocate stream"); + osalDbgAssert(spip->tx.dma != NULL, "unable to allocate stream"); rccEnableSPI6(true); bdmaSetRequestSource(spip->rx.bdma, STM32_DMAMUX2_SPI6_RX); bdmaSetRequestSource(spip->tx.bdma, STM32_DMAMUX2_SPI6_TX); diff --git a/os/hal/src/hal_crypto.c b/os/hal/src/hal_crypto.c index 0a67df67d..4e2914f9c 100644 --- a/os/hal/src/hal_crypto.c +++ b/os/hal/src/hal_crypto.c @@ -724,7 +724,7 @@ cryerror_t cryEncryptAES_GCM(CRYDriver *cryp, osalDbgAssert(cryp->state == CRY_READY, "not ready"); -#if CRY_LLD_SUPPORTS_AES_GCM== TRUE +#if CRY_LLD_SUPPORTS_AES_GCM == TRUE return cry_lld_encrypt_AES_GCM(cryp, key_id, auth_size, auth_in, text_size, text_in, text_out, iv, tag_size, tag_out); @@ -797,7 +797,7 @@ cryerror_t cryDecryptAES_GCM(CRYDriver *cryp, osalDbgAssert(cryp->state == CRY_READY, "not ready"); -#if CRY_LLD_SUPPORTS_AES_GCM== TRUE +#if CRY_LLD_SUPPORTS_AES_GCM == TRUE return cry_lld_decrypt_AES_GCM(cryp, key_id, auth_size, auth_in, text_size, text_in, text_out, iv, tag_size, tag_in); diff --git a/os/oslib/include/chlib.h b/os/oslib/include/chlib.h index 61900db14..b092ba56e 100644 --- a/os/oslib/include/chlib.h +++ b/os/oslib/include/chlib.h @@ -142,7 +142,7 @@ #error "malformed chlicense.h" #endif -#if CH_CUSTOMER_LIC_OSLIB== FALSE +#if CH_CUSTOMER_LIC_OSLIB == FALSE #error "ChibiOS/LIB not licensed" #endif diff --git a/tools/style/style_nil.sh b/tools/style/style_nil.sh index 0f54ed786..12375bf70 100644 --- a/tools/style/style_nil.sh +++ b/tools/style/style_nil.sh @@ -1,3 +1,5 @@ #!/bin/bash find ../../os/nil -name "*.[ch]" -exec perl stylecheck.pl "{}" \; +find ../../os/oslib -name "*.[ch]" -exec perl stylecheck.pl "{}" \; +find ../../os/license -name "*.[ch]" -exec perl stylecheck.pl "{}" \; diff --git a/tools/style/style_rt.sh b/tools/style/style_rt.sh index 1481f951a..d829d03d2 100644 --- a/tools/style/style_rt.sh +++ b/tools/style/style_rt.sh @@ -1,3 +1,5 @@ #!/bin/bash find ../../os/rt -name "*.[ch]" -exec perl stylecheck.pl "{}" \; +find ../../os/oslib -name "*.[ch]" -exec perl stylecheck.pl "{}" \; +find ../../os/license -name "*.[ch]" -exec perl stylecheck.pl "{}" \; diff --git a/tools/style/stylecheck.pl b/tools/style/stylecheck.pl index 98a1d2de2..ac70741ca 100644 --- a/tools/style/stylecheck.pl +++ b/tools/style/stylecheck.pl @@ -167,6 +167,21 @@ foreach my $line (@c_source) { style "detected glued right brace"; } + #**************************************************************************** + # Check on (some) operators. + if ($line =~ /\S!=/) { + style "detected glued != operator"; + } + if ($line =~ /!=\S/) { + style "detected glued != operator"; + } + if ($line =~ /\S==/) { + style "detected glued == operator"; + } + if ($line =~ /!==S/) { + style "detected glued == operator"; + } + #**************************************************************************** # Check function-call-like returns (not perfect so disabled). if ($line =~ /return\s*\(/) {