[PATCH] firmware: arm_scmi: Support loop control in quirk code snippets
Peng Fan
peng.fan at oss.nxp.com
Tue Mar 17 00:25:30 PDT 2026
On Mon, Mar 16, 2026 at 04:34:40PM +0100, Geert Uytterhoeven wrote:
>Each SCMI firmware quirk contains a code snippet, which handles the
>quirk, and has full access to the surrounding context. When this
>context is (part of) a loop body, the code snippet may want to use loop
>control statements like "break" and "continue". Unfortunately the
>SCMI_QUIRK() macro implementation contains a dummy loop, taking
>precedence over any outer loops. Hence quirk code cannot use loop
>control statements, but has to resort to polluting the surrounding
>context with a label, and use goto.
>
>Fix this by replacing the "do { ... } while (0)" construct in the
>SCMI_QUIRK() implementation by "({ ... })".
>
>Signed-off-by: Geert Uytterhoeven <geert+renesas at glider.be>
Reviewed-by: Peng Fan <peng.fan at nxp.com>
More information about the linux-arm-kernel
mailing list