2019-06-27 22:07:27

by Nathan Huckleberry

[permalink] [raw]
Subject: [PATCH] clk: qoriq: Fix -Wunused-const-variable

drivers/clk/clk-qoriq.c:138:38: warning: unused variable
'p5020_cmux_grp1' [-Wunused-const-variable] static const struct
clockgen_muxinfo p5020_cmux_grp1

drivers/clk/clk-qoriq.c:146:38: warning: unused variable
'p5020_cmux_grp2' [-Wunused-const-variable] static const struct
clockgen_muxinfo p5020_cmux_grp2

In the definition of the p5020 chip, the p2041 chip's info was used
instead. The p5020 and p2041 chips have different info. This is most
likely a typo.

Link: https://github.com/ClangBuiltLinux/linux/issues/525
Cc: [email protected]
Signed-off-by: Nathan Huckleberry <[email protected]>
---
drivers/clk/clk-qoriq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c
index 4739a47ec8bd..0f8870527940 100644
--- a/drivers/clk/clk-qoriq.c
+++ b/drivers/clk/clk-qoriq.c
@@ -678,7 +678,7 @@ static const struct clockgen_chipinfo chipinfo[] = {
.guts_compat = "fsl,qoriq-device-config-1.0",
.init_periph = p5020_init_periph,
.cmux_groups = {
- &p2041_cmux_grp1, &p2041_cmux_grp2
+ &p5020_cmux_grp1, &p5020_cmux_grp2
},
.cmux_to_group = {
0, 1, -1
--
2.22.0.410.gd8fdbe21b5-goog


2019-06-27 23:19:52

by Nick Desaulniers

[permalink] [raw]
Subject: Re: [PATCH] clk: qoriq: Fix -Wunused-const-variable

On Thu, Jun 27, 2019 at 3:06 PM 'Nathan Huckleberry' via Clang Built
Linux <[email protected]> wrote:
>
> drivers/clk/clk-qoriq.c:138:38: warning: unused variable
> 'p5020_cmux_grp1' [-Wunused-const-variable] static const struct
> clockgen_muxinfo p5020_cmux_grp1
>
> drivers/clk/clk-qoriq.c:146:38: warning: unused variable
> 'p5020_cmux_grp2' [-Wunused-const-variable] static const struct
> clockgen_muxinfo p5020_cmux_grp2
>
> In the definition of the p5020 chip, the p2041 chip's info was used
> instead. The p5020 and p2041 chips have different info. This is most
> likely a typo.

oops! Further, the definitions of p5020_cmux_grp1/p5020_cmux_grp2 are
subtly different than p2041_cmux_grp1/p2041_cmux_grp2. Definitely
looks copy+pasta related; I agree with your assessment. (Also, it's
interesting to see this sparse array initializer syntax). Thanks for
the patch.
Reviewed-by: Nick Desaulniers <[email protected]>

>
> Link: https://github.com/ClangBuiltLinux/linux/issues/525
> Cc: [email protected]
> Signed-off-by: Nathan Huckleberry <[email protected]>
> ---
> drivers/clk/clk-qoriq.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c
> index 4739a47ec8bd..0f8870527940 100644
> --- a/drivers/clk/clk-qoriq.c
> +++ b/drivers/clk/clk-qoriq.c
> @@ -678,7 +678,7 @@ static const struct clockgen_chipinfo chipinfo[] = {
> .guts_compat = "fsl,qoriq-device-config-1.0",
> .init_periph = p5020_init_periph,
> .cmux_groups = {
> - &p2041_cmux_grp1, &p2041_cmux_grp2
> + &p5020_cmux_grp1, &p5020_cmux_grp2

--
Thanks,
~Nick Desaulniers

2019-06-28 22:02:08

by Crystal Wood

[permalink] [raw]
Subject: Re: [PATCH] clk: qoriq: Fix -Wunused-const-variable

On Thu, 2019-06-27 at 15:06 -0700, Nathan Huckleberry wrote:
> drivers/clk/clk-qoriq.c:138:38: warning: unused variable
> 'p5020_cmux_grp1' [-Wunused-const-variable] static const struct
> clockgen_muxinfo p5020_cmux_grp1
>
> drivers/clk/clk-qoriq.c:146:38: warning: unused variable
> 'p5020_cmux_grp2' [-Wunused-const-variable] static const struct
> clockgen_muxinfo p5020_cmux_grp2
>
> In the definition of the p5020 chip, the p2041 chip's info was used
> instead. The p5020 and p2041 chips have different info. This is most
> likely a typo.
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/525
> Cc: [email protected]
> Signed-off-by: Nathan Huckleberry <[email protected]>

Acked-by: Scott Wood <[email protected]>

-Scott


2019-08-07 21:58:42

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH] clk: qoriq: Fix -Wunused-const-variable

Quoting Nathan Huckleberry (2019-06-27 15:06:42)
> drivers/clk/clk-qoriq.c:138:38: warning: unused variable
> 'p5020_cmux_grp1' [-Wunused-const-variable] static const struct
> clockgen_muxinfo p5020_cmux_grp1
>
> drivers/clk/clk-qoriq.c:146:38: warning: unused variable
> 'p5020_cmux_grp2' [-Wunused-const-variable] static const struct
> clockgen_muxinfo p5020_cmux_grp2
>
> In the definition of the p5020 chip, the p2041 chip's info was used
> instead. The p5020 and p2041 chips have different info. This is most
> likely a typo.
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/525
> Cc: [email protected]
> Signed-off-by: Nathan Huckleberry <[email protected]>
> ---

Applied to clk-next