Michael Niewöhner submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, approved Furquan Shaikh: Looks good to me, approved
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>
---
M src/soc/intel/alderlake/uart.c
M src/soc/intel/apollolake/uart.c
M src/soc/intel/cannonlake/uart.c
M src/soc/intel/common/block/uart/uart.c
M src/soc/intel/elkhartlake/uart.c
M src/soc/intel/icelake/uart.c
M src/soc/intel/jasperlake/uart.c
M src/soc/intel/skylake/uart.c
M src/soc/intel/tigerlake/uart.c
9 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/soc/intel/alderlake/uart.c b/src/soc/intel/alderlake/uart.c
index 46f6220..6e64e0f 100644
--- a/src/soc/intel/alderlake/uart.c
+++ b/src/soc/intel/alderlake/uart.c
@@ -44,4 +44,4 @@
}
};

-const int uart_max_index = ARRAY_SIZE(uart_ctrlr_config);
+const int uart_ctrlr_config_size = ARRAY_SIZE(uart_ctrlr_config);
diff --git a/src/soc/intel/apollolake/uart.c b/src/soc/intel/apollolake/uart.c
index 28ad71a..2a2d7a2 100644
--- a/src/soc/intel/apollolake/uart.c
+++ b/src/soc/intel/apollolake/uart.c
@@ -62,4 +62,4 @@
#endif
};

-const int uart_max_index = ARRAY_SIZE(uart_ctrlr_config);
+const int uart_ctrlr_config_size = ARRAY_SIZE(uart_ctrlr_config);
diff --git a/src/soc/intel/cannonlake/uart.c b/src/soc/intel/cannonlake/uart.c
index c0d0e49..cc44a61 100644
--- a/src/soc/intel/cannonlake/uart.c
+++ b/src/soc/intel/cannonlake/uart.c
@@ -38,4 +38,4 @@
}
};

-const int uart_max_index = ARRAY_SIZE(uart_ctrlr_config);
+const int uart_ctrlr_config_size = ARRAY_SIZE(uart_ctrlr_config);
diff --git a/src/soc/intel/common/block/uart/uart.c b/src/soc/intel/common/block/uart/uart.c
index 69b443c..3a64a16 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 @@
{
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;
diff --git a/src/soc/intel/elkhartlake/uart.c b/src/soc/intel/elkhartlake/uart.c
index c0d0e49..cc44a61 100644
--- a/src/soc/intel/elkhartlake/uart.c
+++ b/src/soc/intel/elkhartlake/uart.c
@@ -38,4 +38,4 @@
}
};

-const int uart_max_index = ARRAY_SIZE(uart_ctrlr_config);
+const int uart_ctrlr_config_size = ARRAY_SIZE(uart_ctrlr_config);
diff --git a/src/soc/intel/icelake/uart.c b/src/soc/intel/icelake/uart.c
index c0d0e49..cc44a61 100644
--- a/src/soc/intel/icelake/uart.c
+++ b/src/soc/intel/icelake/uart.c
@@ -38,4 +38,4 @@
}
};

-const int uart_max_index = ARRAY_SIZE(uart_ctrlr_config);
+const int uart_ctrlr_config_size = ARRAY_SIZE(uart_ctrlr_config);
diff --git a/src/soc/intel/jasperlake/uart.c b/src/soc/intel/jasperlake/uart.c
index c0d0e49..cc44a61 100644
--- a/src/soc/intel/jasperlake/uart.c
+++ b/src/soc/intel/jasperlake/uart.c
@@ -38,4 +38,4 @@
}
};

-const int uart_max_index = ARRAY_SIZE(uart_ctrlr_config);
+const int uart_ctrlr_config_size = ARRAY_SIZE(uart_ctrlr_config);
diff --git a/src/soc/intel/skylake/uart.c b/src/soc/intel/skylake/uart.c
index 9e2dcb3..4235788 100644
--- a/src/soc/intel/skylake/uart.c
+++ b/src/soc/intel/skylake/uart.c
@@ -37,4 +37,4 @@
}
};

-const int uart_max_index = ARRAY_SIZE(uart_ctrlr_config);
+const int uart_ctrlr_config_size = ARRAY_SIZE(uart_ctrlr_config);
diff --git a/src/soc/intel/tigerlake/uart.c b/src/soc/intel/tigerlake/uart.c
index 5ae54d5..a3aee39 100644
--- a/src/soc/intel/tigerlake/uart.c
+++ b/src/soc/intel/tigerlake/uart.c
@@ -44,4 +44,4 @@
}
};

-const int uart_max_index = ARRAY_SIZE(uart_ctrlr_config);
+const int uart_ctrlr_config_size = ARRAY_SIZE(uart_ctrlr_config);

To view, visit change 49305. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I7409c9dc040c3c6ad718abc96f268c187d50d79c
Gerrit-Change-Number: 49305
Gerrit-PatchSet: 3
Gerrit-Owner: Michael Niewöhner <foss@mniewoehner.de>
Gerrit-Reviewer: Felix Singer <felixsinger@posteo.net>
Gerrit-Reviewer: Andrey Petrov <andrey.petrov@gmail.com>
Gerrit-Reviewer: Furquan Shaikh <furquan@google.com>
Gerrit-Reviewer: Karthik Ramasubramanian <kramasub@google.com>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki@gmail.com>
Gerrit-Reviewer: Michael Niewöhner <foss@mniewoehner.de>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: Patrick Rudolph <siro@das-labor.org>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak@chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-MessageType: merged