diff options
author | Michael Niewöhner <foss@mniewoehner.de> | 2021-01-11 13:21:19 +0100 |
---|---|---|
committer | Michael Niewöhner <foss@mniewoehner.de> | 2021-01-12 23:38:32 +0000 |
commit | f3faddc4868ddec7806cc9413e33225d87a157a4 (patch) | |
tree | 390e92cb83357d424fc5fc246bc7021e8bf3943c /src/soc/intel/common | |
parent | 2bec7f0a1183102e142e6c4bdabdbc20252164fd (diff) |
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>
Diffstat (limited to 'src/soc/intel/common')
-rw-r--r-- | src/soc/intel/common/block/uart/uart.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/soc/intel/common/block/uart/uart.c b/src/soc/intel/common/block/uart/uart.c index 69b443c8a2..3a64a16e6f 100644 --- a/src/soc/intel/common/block/uart/uart.c +++ b/src/soc/intel/common/block/uart/uart.c @@ -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; |