[PATCH 2/3] firmware: arm_scmi: quirk: Simplify quirk table iteration

Geert Uytterhoeven
2026-04-03T08:41:49Z

The current table entry is assigned in both the init and loop
expressions of the for-statement. Merge this into a single assignment
in the conditional expression, to simplify the code.

While at it, make the loop counter unsigned and loop-local.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/firmware/arm_scmi/quirks.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/firmware/arm_scmi/quirks.c b/drivers/firmware/arm_scmi/quirks.c
index b1d9cd9fa2427879..2b38ba3f59a13c9e 100644
--- a/drivers/firmware/arm_scmi/quirks.c
+++ b/drivers/firmware/arm_scmi/quirks.c
@@ -258,10 +258,8 @@ static int scmi_quirk_range_parse(struct scmi_quirk *quirk)
void scmi_quirks_initialize(void)
{
struct scmi_quirk *quirk;
- int i;

- for (i = 0, quirk = scmi_quirks_table[0]; quirk;
- i++, quirk = scmi_quirks_table[i]) {
+ for (unsigned int i = 0; (quirk = scmi_quirks_table[i]); i++) {
int ret;

ret = scmi_quirk_range_parse(quirk);
--
2.43.0