summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAngel Pons <th3fanbus@gmail.com>2021-03-25 11:29:32 +0100
committerAngel Pons <th3fanbus@gmail.com>2021-03-28 14:11:38 +0000
commitc57cae8c8b6b3cd492470d718c06ca931094b3be (patch)
tree8d392937225d936532cb223cb12bdc47047a5b42 /src
parentcf72a51abf1b999c1ea9fc72c91c206b4e4bfdfb (diff)
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 <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/51794 Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Felix Held <felix-coreboot@felixheld.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src')
-rw-r--r--src/soc/amd/common/block/i2c/i2c.c5
-rw-r--r--src/soc/amd/common/block/include/amdblocks/i2c.h2
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 <device/i2c.h>
#include <device/mmio.h>
#include <drivers/i2c/designware/dw_i2c.h>
+#include <types.h>
#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. */