[HAL][SMBUS] Enhance HAL code quality for MISRA-C Rule-8.13 by adding const qualifiers
diff --git a/Inc/stm32g0xx_hal_smbus.h b/Inc/stm32g0xx_hal_smbus.h index 42b10d1..600e37a 100644 --- a/Inc/stm32g0xx_hal_smbus.h +++ b/Inc/stm32g0xx_hal_smbus.h
@@ -751,8 +751,8 @@ */ /* Peripheral State and Errors functions **************************************************/ -uint32_t HAL_SMBUS_GetState(SMBUS_HandleTypeDef *hsmbus); -uint32_t HAL_SMBUS_GetError(SMBUS_HandleTypeDef *hsmbus); +uint32_t HAL_SMBUS_GetState(const SMBUS_HandleTypeDef *hsmbus); +uint32_t HAL_SMBUS_GetError(const SMBUS_HandleTypeDef *hsmbus); /** * @}
diff --git a/Src/stm32g0xx_hal_smbus.c b/Src/stm32g0xx_hal_smbus.c index 219c3be..d9b4028 100644 --- a/Src/stm32g0xx_hal_smbus.c +++ b/Src/stm32g0xx_hal_smbus.c
@@ -1831,7 +1831,7 @@ * the configuration information for the specified SMBUS. * @retval HAL state */ -uint32_t HAL_SMBUS_GetState(SMBUS_HandleTypeDef *hsmbus) +uint32_t HAL_SMBUS_GetState(const SMBUS_HandleTypeDef *hsmbus) { /* Return SMBUS handle state */ return hsmbus->State; @@ -1843,7 +1843,7 @@ * the configuration information for the specified SMBUS. * @retval SMBUS Error Code */ -uint32_t HAL_SMBUS_GetError(SMBUS_HandleTypeDef *hsmbus) +uint32_t HAL_SMBUS_GetError(const SMBUS_HandleTypeDef *hsmbus) { return hsmbus->ErrorCode; }