Thread (65 messages) 65 messages, 3 authors, 2024-02-29

Re: [PATCH v2 10/30] pinctrl: nomadik: minimise indentation in probe

From: Linus Walleij <hidden>
Date: 2024-02-29 09:26:48
Also in: linux-devicetree, linux-gpio, linux-mips, lkml

On Wed, Feb 28, 2024 at 12:28 PM Théo Lebrun [off-list ref] wrote:
nmk_pinctrl_probe() iterates over each GPIO block. Use an early
conditional continue to skip to the next iteration rather than indent
all the loop code block.

Do not change code logic. The block is changed from:

        for (i = 0; i < NMK_MAX_BANKS; i++) {
                x = of_parse_phandle(...);
                if (x) {
                        ... do work ...
                }
        }

To:

        for (i = 0; i < NMK_MAX_BANKS; i++) {
                x = of_parse_phandle(...);
                if (!x)
                        continue;

                ... do work ...
        }

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Patch applied!

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help