From c57cae8c8b6b3cd492470d718c06ca931094b3be Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Thu, 25 Mar 2021 11:29:32 +0100 Subject: [PATCH] soc/amd/common/block/i2c: Use `size_t` for `num_pins` There's no need to use a fixed-width type here. Change-Id: I727c64661990040db356c5508fecc0a65960c095 Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/51794 Reviewed-by: Marshall Dawson Reviewed-by: Paul Menzel Reviewed-by: Felix Held Tested-by: build bot (Jenkins) --- src/soc/amd/common/block/i2c/i2c.c | 5 +++-- src/soc/amd/common/block/include/amdblocks/i2c.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/soc/amd/common/block/i2c/i2c.c b/src/soc/amd/common/block/i2c/i2c.c index 30fa6e7362..ba89e9c589 100644 --- a/src/soc/amd/common/block/i2c/i2c.c +++ b/src/soc/amd/common/block/i2c/i2c.c @@ -12,6 +12,7 @@ #include #include #include +#include #define MAX_PIN_COUNT 4 @@ -154,7 +155,7 @@ static void restore_i2c_pin_registers(uint8_t gpio, struct common_i2c_save *save static void drive_scl(const struct soc_i2c_peripheral_reset_info *reset_info, uint32_t val) { - uint8_t j; + size_t j; for (j = 0; j < reset_info->num_pins; j++) { if (reset_info->i2c_scl_reset_mask & reset_info->i2c_scl[j].pin_mask) @@ -172,7 +173,7 @@ static void drive_scl(const struct soc_i2c_peripheral_reset_info *reset_info, ui void sb_reset_i2c_peripherals(const struct soc_i2c_peripheral_reset_info *reset_info) { struct common_i2c_save save_table[MAX_PIN_COUNT]; - uint8_t i; + size_t i; if (!reset_info || !reset_info->i2c_scl || !reset_info->num_pins || !reset_info->i2c_scl_reset_mask) diff --git a/src/soc/amd/common/block/include/amdblocks/i2c.h b/src/soc/amd/common/block/include/amdblocks/i2c.h index 497de6f28e..4a7a7e83a0 100644 --- a/src/soc/amd/common/block/include/amdblocks/i2c.h +++ b/src/soc/amd/common/block/include/amdblocks/i2c.h @@ -46,7 +46,7 @@ struct soc_i2c_scl_pin { struct soc_i2c_peripheral_reset_info { uint8_t i2c_scl_reset_mask; const struct soc_i2c_scl_pin *i2c_scl; - uint32_t num_pins; + size_t num_pins; }; /* Helper function to perform misc I2C configuration specific to SoC. */