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>
This commit is contained in:
parent
cf72a51abf
commit
c57cae8c8b
|
@ -12,6 +12,7 @@
|
||||||
#include <device/i2c.h>
|
#include <device/i2c.h>
|
||||||
#include <device/mmio.h>
|
#include <device/mmio.h>
|
||||||
#include <drivers/i2c/designware/dw_i2c.h>
|
#include <drivers/i2c/designware/dw_i2c.h>
|
||||||
|
#include <types.h>
|
||||||
|
|
||||||
#define MAX_PIN_COUNT 4
|
#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)
|
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++) {
|
for (j = 0; j < reset_info->num_pins; j++) {
|
||||||
if (reset_info->i2c_scl_reset_mask & reset_info->i2c_scl[j].pin_mask)
|
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)
|
void sb_reset_i2c_peripherals(const struct soc_i2c_peripheral_reset_info *reset_info)
|
||||||
{
|
{
|
||||||
struct common_i2c_save save_table[MAX_PIN_COUNT];
|
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 ||
|
if (!reset_info || !reset_info->i2c_scl || !reset_info->num_pins ||
|
||||||
!reset_info->i2c_scl_reset_mask)
|
!reset_info->i2c_scl_reset_mask)
|
||||||
|
|
|
@ -46,7 +46,7 @@ struct soc_i2c_scl_pin {
|
||||||
struct soc_i2c_peripheral_reset_info {
|
struct soc_i2c_peripheral_reset_info {
|
||||||
uint8_t i2c_scl_reset_mask;
|
uint8_t i2c_scl_reset_mask;
|
||||||
const struct soc_i2c_scl_pin *i2c_scl;
|
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. */
|
/* Helper function to perform misc I2C configuration specific to SoC. */
|
||||||
|
|
Loading…
Reference in New Issue