]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
firmware: arm_scmi: quirk: Simplify quirk table iteration
authorGeert Uytterhoeven <geert+renesas@glider.be>
Fri, 3 Apr 2026 08:41:30 +0000 (10:41 +0200)
committerSudeep Holla <sudeep.holla@kernel.org>
Tue, 5 May 2026 14:45:59 +0000 (15:45 +0100)
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>
Link: https://patch.msgid.link/8577f4b103cf04420c3b67dcaad528daff867287.1775205358.git.geert+renesas@glider.be
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
drivers/firmware/arm_scmi/quirks.c

index b31f23e2bbbcba2d256c896a80d886fe325c191e..9ed5ce4feded1652adba92786bb444ce43329951 100644 (file)
@@ -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);