soc/intel: rename uart_max_index
The name `..._index` is confusing since the maximum index of an array is not `ARRAY_SIZE(array)` but `ARRAY_SIZE(array) - 1`. Rename `uart_max_index` to `uart_ctrlr_config_size` to make the name match the variable´s value. Change-Id: I7409c9dc040c3c6ad718abc96f268c187d50d79c Signed-off-by: Michael Niewöhner <foss@mniewoehner.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/49305 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
parent
2bec7f0a11
commit
f3faddc486
|
@ -44,4 +44,4 @@ const struct uart_controller_config uart_ctrlr_config[] = {
|
|||
}
|
||||
};
|
||||
|
||||
const int uart_max_index = ARRAY_SIZE(uart_ctrlr_config);
|
||||
const int uart_ctrlr_config_size = ARRAY_SIZE(uart_ctrlr_config);
|
||||
|
|
|
@ -62,4 +62,4 @@ const struct uart_controller_config uart_ctrlr_config[] = {
|
|||
#endif
|
||||
};
|
||||
|
||||
const int uart_max_index = ARRAY_SIZE(uart_ctrlr_config);
|
||||
const int uart_ctrlr_config_size = ARRAY_SIZE(uart_ctrlr_config);
|
||||
|
|
|
@ -38,4 +38,4 @@ const struct uart_controller_config uart_ctrlr_config[] = {
|
|||
}
|
||||
};
|
||||
|
||||
const int uart_max_index = ARRAY_SIZE(uart_ctrlr_config);
|
||||
const int uart_ctrlr_config_size = ARRAY_SIZE(uart_ctrlr_config);
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#define UART_CONSOLE_INVALID_INDEX 0xFF
|
||||
|
||||
extern const struct uart_controller_config uart_ctrlr_config[];
|
||||
extern const int uart_max_index;
|
||||
extern const int uart_ctrlr_config_size;
|
||||
|
||||
static void uart_lpss_init(pci_devfn_t dev, uintptr_t baseaddr)
|
||||
{
|
||||
|
@ -49,7 +49,7 @@ static int uart_get_valid_index(void)
|
|||
{
|
||||
int index;
|
||||
|
||||
for (index = 0; index < uart_max_index; index++) {
|
||||
for (index = 0; index < uart_ctrlr_config_size; index++) {
|
||||
if (uart_ctrlr_config[index].console_index ==
|
||||
CONFIG_UART_FOR_CONSOLE)
|
||||
return index;
|
||||
|
|
|
@ -38,4 +38,4 @@ const struct uart_controller_config uart_ctrlr_config[] = {
|
|||
}
|
||||
};
|
||||
|
||||
const int uart_max_index = ARRAY_SIZE(uart_ctrlr_config);
|
||||
const int uart_ctrlr_config_size = ARRAY_SIZE(uart_ctrlr_config);
|
||||
|
|
|
@ -38,4 +38,4 @@ const struct uart_controller_config uart_ctrlr_config[] = {
|
|||
}
|
||||
};
|
||||
|
||||
const int uart_max_index = ARRAY_SIZE(uart_ctrlr_config);
|
||||
const int uart_ctrlr_config_size = ARRAY_SIZE(uart_ctrlr_config);
|
||||
|
|
|
@ -38,4 +38,4 @@ const struct uart_controller_config uart_ctrlr_config[] = {
|
|||
}
|
||||
};
|
||||
|
||||
const int uart_max_index = ARRAY_SIZE(uart_ctrlr_config);
|
||||
const int uart_ctrlr_config_size = ARRAY_SIZE(uart_ctrlr_config);
|
||||
|
|
|
@ -37,4 +37,4 @@ const struct uart_controller_config uart_ctrlr_config[] = {
|
|||
}
|
||||
};
|
||||
|
||||
const int uart_max_index = ARRAY_SIZE(uart_ctrlr_config);
|
||||
const int uart_ctrlr_config_size = ARRAY_SIZE(uart_ctrlr_config);
|
||||
|
|
|
@ -44,4 +44,4 @@ const struct uart_controller_config uart_ctrlr_config[] = {
|
|||
}
|
||||
};
|
||||
|
||||
const int uart_max_index = ARRAY_SIZE(uart_ctrlr_config);
|
||||
const int uart_ctrlr_config_size = ARRAY_SIZE(uart_ctrlr_config);
|
||||
|
|
Loading…
Reference in New Issue