From f3faddc4868ddec7806cc9413e33225d87a157a4 Mon Sep 17 00:00:00 2001 From: Michael Niewöhner Date: Mon, 11 Jan 2021 13:21:19 +0100 Subject: soc/intel: rename uart_max_index MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/49305 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber Reviewed-by: Furquan Shaikh --- src/soc/intel/common/block/uart/uart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/soc/intel/common/block/uart') 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; -- cgit v1.2.3