diff mbox

[4/4] clk/Renesas-MSTP: Rename jump labels in cpg_mstp_attach_dev()

Message ID e28d35f9-e519-5f3b-c27d-958605b5b851@users.sourceforge.net (mailing list archive)
State Rejected, archived
Delegated to: Stephen Boyd
Headers show

Commit Message

SF Markus Elfring Sept. 14, 2016, 8:04 p.m. UTC
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 14 Sep 2016 21:41:50 +0200

Adjust jump labels according to the current Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/clk/renesas/clk-mstp.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

Comments

Geert Uytterhoeven Sept. 15, 2016, 7:18 p.m. UTC | #1
Hi Markus,

On Wed, Sep 14, 2016 at 10:04 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Wed, 14 Sep 2016 21:41:50 +0200
>
> Adjust jump labels according to the current Linux coding style convention.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/clk/renesas/clk-mstp.c | 16 +++++++---------
>  1 file changed, 7 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/clk/renesas/clk-mstp.c b/drivers/clk/renesas/clk-mstp.c
> index 6c82e0e..2f90718 100644
> --- a/drivers/clk/renesas/clk-mstp.c
> +++ b/drivers/clk/renesas/clk-mstp.c
> @@ -256,19 +256,18 @@ int cpg_mstp_attach_dev(struct generic_pm_domain *unused, struct device *dev)
>                                            &clkspec)) {
>                 if (of_device_is_compatible(clkspec.np,
>                                             "renesas,cpg-mstp-clocks"))
> -                       goto found;
> +                       goto get_clk;
>
>                 /* BSC on r8a73a4/sh73a0 uses zb_clk instead of an mstp clock */
>                 if (!strcmp(clkspec.np->name, "zb_clk"))
> -                       goto found;
> +                       goto get_clk;
>
>                 of_node_put(clkspec.np);
>                 i++;
>         }
>
>         return 0;
> -
> -found:
> + get_clk:

"Choose label names which say what the goto does or why the goto exists."

I prefer the "why" over the "what".

And the "indent labels with a single space" rule will be removed soon, as
there's no longer a technical reason for it after
https://lkml.org/lkml/2016/9/7/316

>         clk = of_clk_get_from_provider(&clkspec);
>         of_node_put(clkspec.np);
>
> @@ -278,20 +277,19 @@ found:
>         error = pm_clk_create(dev);
>         if (error) {
>                 dev_err(dev, "pm_clk_create failed %d\n", error);
> -               goto fail_put;
> +               goto put_clk;
>         }
>
>         error = pm_clk_add_clk(dev, clk);
>         if (error) {
>                 dev_err(dev, "pm_clk_add_clk %pC failed %d\n", clk, error);
> -               goto fail_destroy;
> +               goto destroy_clk;
>         }
>
>         return 0;
> -
> -fail_destroy:
> + destroy_clk:
>         pm_clk_destroy(dev);
> -fail_put:
> + put_clk:

Same here.

>         clk_put(clk);
>         return error;
>  }

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-clk" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
SF Markus Elfring Sept. 16, 2016, 6 a.m. UTC | #2
> "Choose label names which say what the goto does or why the goto exists."
> 
> I prefer the "why" over the "what".

Does your opinion indicate also that you would appreciate another adjustment
around the quoted sentence from "Chapter 7: Centralized exiting of functions"
of the document "CodingStyle"?

Would you like to achieve that the potential for confusion will be reduced
a bit more there?


> And the "indent labels with a single space" rule will be removed soon,

I am unsure on how this "story" will evolve further.

Will the indentation rules become any more precise for Linux source code?


> as there's no longer a technical reason for it after
> https://lkml.org/lkml/2016/9/7/316

The software update "Set git diff driver for C source code files" is also
interesting for current versions.

Will language-specific rules which are supported by recent Git software
influence any capabilities for the command "diff --show-c-function"?

Regards,
Markus
--
To unsubscribe from this list: send the line "unsubscribe linux-clk" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/clk/renesas/clk-mstp.c b/drivers/clk/renesas/clk-mstp.c
index 6c82e0e..2f90718 100644
--- a/drivers/clk/renesas/clk-mstp.c
+++ b/drivers/clk/renesas/clk-mstp.c
@@ -256,19 +256,18 @@  int cpg_mstp_attach_dev(struct generic_pm_domain *unused, struct device *dev)
 					   &clkspec)) {
 		if (of_device_is_compatible(clkspec.np,
 					    "renesas,cpg-mstp-clocks"))
-			goto found;
+			goto get_clk;
 
 		/* BSC on r8a73a4/sh73a0 uses zb_clk instead of an mstp clock */
 		if (!strcmp(clkspec.np->name, "zb_clk"))
-			goto found;
+			goto get_clk;
 
 		of_node_put(clkspec.np);
 		i++;
 	}
 
 	return 0;
-
-found:
+ get_clk:
 	clk = of_clk_get_from_provider(&clkspec);
 	of_node_put(clkspec.np);
 
@@ -278,20 +277,19 @@  found:
 	error = pm_clk_create(dev);
 	if (error) {
 		dev_err(dev, "pm_clk_create failed %d\n", error);
-		goto fail_put;
+		goto put_clk;
 	}
 
 	error = pm_clk_add_clk(dev, clk);
 	if (error) {
 		dev_err(dev, "pm_clk_add_clk %pC failed %d\n", clk, error);
-		goto fail_destroy;
+		goto destroy_clk;
 	}
 
 	return 0;
-
-fail_destroy:
+ destroy_clk:
 	pm_clk_destroy(dev);
-fail_put:
+ put_clk:
 	clk_put(clk);
 	return error;
 }