aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/templates
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2019-01-26 08:32:07 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2019-01-26 08:32:07 +0000
commit57d31cabcfedbab69c74cde694f8fe1ec652385d (patch)
treefefaa32d234406c79aecfd43d69be09077797593 /os/hal/templates
parent2c757aacd0569a7cf824513ec34e5ed976291597 (diff)
downloadChibiOS-57d31cabcfedbab69c74cde694f8fe1ec652385d.tar.gz
ChibiOS-57d31cabcfedbab69c74cde694f8fe1ec652385d.tar.bz2
ChibiOS-57d31cabcfedbab69c74cde694f8fe1ec652385d.zip
MISRA-related fixes.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12586 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'os/hal/templates')
-rw-r--r--os/hal/templates/hal_adc_lld.h8
-rw-r--r--os/hal/templates/hal_crypto_lld.c27
-rw-r--r--os/hal/templates/hal_dac_lld.h15
-rw-r--r--os/hal/templates/hal_i2s_lld.h8
-rw-r--r--os/hal/templates/hal_spi_lld.h8
-rw-r--r--os/hal/templates/hal_trng_lld.h12
-rw-r--r--os/hal/templates/hal_wspi_lld.h12
7 files changed, 43 insertions, 47 deletions
diff --git a/os/hal/templates/hal_adc_lld.h b/os/hal/templates/hal_adc_lld.h
index d337dd2aa..4ba9bc0dd 100644
--- a/os/hal/templates/hal_adc_lld.h
+++ b/os/hal/templates/hal_adc_lld.h
@@ -85,7 +85,9 @@ typedef enum {
/**
* @brief Low level fields of the ADC driver structure.
*/
-#define adc_lld_driver_fields
+#define adc_lld_driver_fields \
+ /* Dummy field, it is not needed.*/ \
+ uint32_t dummy
/**
* @brief Low level fields of the ADC configuration structure.
@@ -97,7 +99,9 @@ typedef enum {
/**
* @brief Low level fields of the ADC configuration structure.
*/
-#define adc_lld_configuration_group_fields
+#define adc_lld_configuration_group_fields \
+ /* Dummy configuration, it is not needed.*/ \
+ uint32_t dummy
/*===========================================================================*/
/* External declarations. */
diff --git a/os/hal/templates/hal_crypto_lld.c b/os/hal/templates/hal_crypto_lld.c
index 65433f928..3c2cb43c6 100644
--- a/os/hal/templates/hal_crypto_lld.c
+++ b/os/hal/templates/hal_crypto_lld.c
@@ -113,20 +113,11 @@ cryerror_t cry_lld_aes_loadkey(CRYDriver *cryp,
size_t size,
const uint8_t *keyp) {
- osalDbgCheck((cryp != NULL) && (keyp != NULL));
-
-
-#if CRY_LLD_SUPPORTS_AES == TRUE
- return cry_lld_aes_loadkey(cryp, size, keyp);
-#elif HAL_CRY_USE_FALLBACK == TRUE
- return cry_fallback_aes_loadkey(cryp, size, keyp);
-#else
(void)cryp;
(void)size;
(void)keyp;
return CRY_ERR_INV_ALGO;
-#endif
}
/**
@@ -693,20 +684,11 @@ cryerror_t cry_lld_des_loadkey(CRYDriver *cryp,
size_t size,
const uint8_t *keyp) {
- osalDbgCheck((cryp != NULL) && (keyp != NULL));
-
-
-#if CRY_LLD_SUPPORTS_DES == TRUE
- return cry_lld_des_loadkey(cryp, size, keyp);
-#elif HAL_CRY_USE_FALLBACK == TRUE
- return cry_fallback_des_loadkey(cryp, size, keyp);
-#else
(void)cryp;
(void)size;
(void)keyp;
return CRY_ERR_INV_ALGO;
-#endif
}
/**
@@ -1206,20 +1188,11 @@ cryerror_t cry_lld_hmac_loadkey(CRYDriver *cryp,
size_t size,
const uint8_t *keyp) {
- osalDbgCheck((cryp != NULL) && (keyp != NULL));
-
-#if (CRY_LLD_SUPPORTS_HMAC_SHA256 == TRUE) || \
- (CRY_LLD_SUPPORTS_HMAC_SHA512 == TRUE)
- return cry_lld_hmac_loadkey(cryp, size, keyp);
-#elif HAL_CRY_USE_FALLBACK == TRUE
- return cry_fallback_hmac_loadkey(cryp, size, keyp);
-#else
(void)cryp;
(void)size;
(void)keyp;
return CRY_ERR_INV_ALGO;
-#endif
}
/**
diff --git a/os/hal/templates/hal_dac_lld.h b/os/hal/templates/hal_dac_lld.h
index 12f2760c4..ab7b1872e 100644
--- a/os/hal/templates/hal_dac_lld.h
+++ b/os/hal/templates/hal_dac_lld.h
@@ -25,7 +25,7 @@
#ifndef HAL_DAC_LLD_H
#define HAL_DAC_LLD_H
-#if HAL_USE_DAC || defined(__DOXYGEN__)
+#if (HAL_USE_DAC == TRUE) || defined(__DOXYGEN__)
/*===========================================================================*/
/* Driver constants. */
@@ -89,7 +89,9 @@ typedef enum {
/**
* @brief Low level fields of the DAC driver structure.
*/
-#define dac_lld_driver_fields
+#define dac_lld_driver_fields \
+ /* Dummy field, it is not needed.*/ \
+ uint32_t dummy
/**
* @brief Low level fields of the DAC configuration structure.
@@ -101,13 +103,16 @@ typedef enum {
/**
* @brief Low level fields of the DAC group configuration structure.
*/
-#define dac_lld_conversion_group_fields
+#define dac_lld_conversion_group_fields \
+ /* Dummy configuration, it is not needed.*/ \
+ uint32_t dummy
+
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
-#if PLATFORM_DAC_USE_DAC1 && !defined(__DOXYGEN__)
+#if (PLATFORM_DAC_USE_DAC1 == TRUE) && !defined(__DOXYGEN__)
extern DACDriver DACD1;
#endif
@@ -126,7 +131,7 @@ extern "C" {
}
#endif
-#endif /* HAL_USE_DAC */
+#endif /* HAL_USE_DAC == TRUE */
#endif /* HAL_DAC_LLD_H */
diff --git a/os/hal/templates/hal_i2s_lld.h b/os/hal/templates/hal_i2s_lld.h
index 5b01183b4..2bd1a62d2 100644
--- a/os/hal/templates/hal_i2s_lld.h
+++ b/os/hal/templates/hal_i2s_lld.h
@@ -64,12 +64,16 @@
/**
* @brief Low level fields of the I2S driver structure.
*/
-#define i2s_lld_driver_fields
+#define i2s_lld_driver_fields \
+ /* Dummy field, it is not needed.*/ \
+ uint32_t dummy
/**
* @brief Low level fields of the I2S configuration structure.
*/
-#define i2s_lld_config_fields
+#define i2s_lld_config_fields \
+ /* Dummy configuration, it is not needed.*/ \
+ uint32_t dummy
/*===========================================================================*/
/* External declarations. */
diff --git a/os/hal/templates/hal_spi_lld.h b/os/hal/templates/hal_spi_lld.h
index ad3939c9b..b3f180a9d 100644
--- a/os/hal/templates/hal_spi_lld.h
+++ b/os/hal/templates/hal_spi_lld.h
@@ -69,12 +69,16 @@
/**
* @brief Low level fields of the SPI driver structure.
*/
-#define spi_lld_driver_fields
+#define spi_lld_driver_fields \
+ /* Dummy field, it is not needed.*/ \
+ uint32_t dummy
/**
* @brief Low level fields of the SPI configuration structure.
*/
-#define spi_lld_config_fields
+#define spi_lld_config_fields \
+ /* Dummy configuration, it is not needed.*/ \
+ uint32_t dummy
/*===========================================================================*/
/* External declarations. */
diff --git a/os/hal/templates/hal_trng_lld.h b/os/hal/templates/hal_trng_lld.h
index 1c7cfc7e7..c43d09bc2 100644
--- a/os/hal/templates/hal_trng_lld.h
+++ b/os/hal/templates/hal_trng_lld.h
@@ -62,17 +62,19 @@
/*===========================================================================*/
/**
+ * @brief Low level fields of the TRNG driver structure.
+ */
+#define trng_lld_driver_fields \
+ /* Dummy field, it is not needed.*/ \
+ uint32_t dummy
+
+/**
* @brief Low level fields of the TRNG configuration structure.
*/
#define trng_lld_config_fields \
/* Dummy configuration, it is not needed.*/ \
uint32_t dummy
-/**
- * @brief Low level fields of the TRNG driver structure.
- */
-#define trng_lld_driver_fields
-
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
diff --git a/os/hal/templates/hal_wspi_lld.h b/os/hal/templates/hal_wspi_lld.h
index 4c006f296..6df16d0d1 100644
--- a/os/hal/templates/hal_wspi_lld.h
+++ b/os/hal/templates/hal_wspi_lld.h
@@ -70,14 +70,18 @@
/*===========================================================================*/
/**
- * @brief Low level fields of the WSPI configuration structure.
+ * @brief Low level fields of the WSPI driver structure.
*/
-#define wspi_lld_config_fields
+#define wspi_lld_driver_fields \
+ /* Dummy field, it is not needed.*/ \
+ uint32_t dummy
/**
- * @brief Low level fields of the WSPI driver structure.
+ * @brief Low level fields of the WSPI configuration structure.
*/
-#define wspi_lld_driver_fields
+#define wspi_lld_config_fields \
+ /* Dummy configuration, it is not needed.*/ \
+ uint32_t dummy
/*===========================================================================*/
/* External declarations. */