* [PATCH v2 1/1] clk: sifive: Fix W=1 kernel build warning
@ 2021-12-08 10:06 Zong Li
2022-01-05 4:24 ` Zong Li
2022-01-05 23:40 ` Stephen Boyd
0 siblings, 2 replies; 5+ messages in thread
From: Zong Li @ 2021-12-08 10:06 UTC (permalink / raw)
To: mturquette, sboyd, palmer, paul.walmsley, lee.jones, linux-clk,
linux-riscv
Cc: Zong Li
This commit reverts commit 487dc7bb6a0c ("clk: sifive: fu540-prci:
Declare static const variable 'prci_clk_fu540' where it's used").
For fixing W=1 kernel build warning(s) about ‘prci_clk_fu540’ defined
but not used [-Wunused-const-variable=], the problem is that the C file
of fu540 and fu740 doesn't use these variables, but they includes the
header files. We could refine the code by moving the definition of these
variable into fu540 and fu740 implementation respectively, instead of
common core code, then we could still separate the SoCs-dependent data
in their own implementation.
Signed-off-by: Zong Li <zong.li@sifive.com>
---
drivers/clk/sifive/fu540-prci.c | 6 +++++-
drivers/clk/sifive/fu540-prci.h | 6 +-----
drivers/clk/sifive/fu740-prci.c | 6 +++++-
drivers/clk/sifive/fu740-prci.h | 11 +----------
drivers/clk/sifive/sifive-prci.c | 5 -----
5 files changed, 12 insertions(+), 22 deletions(-)
diff --git a/drivers/clk/sifive/fu540-prci.c b/drivers/clk/sifive/fu540-prci.c
index 29bab915003c..5568bc26e36f 100644
--- a/drivers/clk/sifive/fu540-prci.c
+++ b/drivers/clk/sifive/fu540-prci.c
@@ -20,7 +20,6 @@
#include <dt-bindings/clock/sifive-fu540-prci.h>
-#include "fu540-prci.h"
#include "sifive-prci.h"
/* PRCI integration data for each WRPLL instance */
@@ -87,3 +86,8 @@ struct __prci_clock __prci_init_clocks_fu540[] = {
.ops = &sifive_fu540_prci_tlclksel_clk_ops,
},
};
+
+struct prci_clk_desc prci_clk_fu540 = {
+ .clks = __prci_init_clocks_fu540,
+ .num_clks = ARRAY_SIZE(__prci_init_clocks_fu540),
+};
diff --git a/drivers/clk/sifive/fu540-prci.h b/drivers/clk/sifive/fu540-prci.h
index c220677dc010..931d6cad8c1c 100644
--- a/drivers/clk/sifive/fu540-prci.h
+++ b/drivers/clk/sifive/fu540-prci.h
@@ -7,10 +7,6 @@
#ifndef __SIFIVE_CLK_FU540_PRCI_H
#define __SIFIVE_CLK_FU540_PRCI_H
-#include "sifive-prci.h"
-
-#define NUM_CLOCK_FU540 4
-
-extern struct __prci_clock __prci_init_clocks_fu540[NUM_CLOCK_FU540];
+extern struct prci_clk_desc prci_clk_fu540;
#endif /* __SIFIVE_CLK_FU540_PRCI_H */
diff --git a/drivers/clk/sifive/fu740-prci.c b/drivers/clk/sifive/fu740-prci.c
index 53f6e00a03b9..0ade3dcd24ed 100644
--- a/drivers/clk/sifive/fu740-prci.c
+++ b/drivers/clk/sifive/fu740-prci.c
@@ -8,7 +8,6 @@
#include <dt-bindings/clock/sifive-fu740-prci.h>
-#include "fu540-prci.h"
#include "sifive-prci.h"
/* PRCI integration data for each WRPLL instance */
@@ -132,3 +131,8 @@ struct __prci_clock __prci_init_clocks_fu740[] = {
.ops = &sifive_fu740_prci_pcie_aux_clk_ops,
},
};
+
+struct prci_clk_desc prci_clk_fu740 = {
+ .clks = __prci_init_clocks_fu740,
+ .num_clks = ARRAY_SIZE(__prci_init_clocks_fu740),
+};
diff --git a/drivers/clk/sifive/fu740-prci.h b/drivers/clk/sifive/fu740-prci.h
index 511a0bf7ba2b..5bc0e18f058c 100644
--- a/drivers/clk/sifive/fu740-prci.h
+++ b/drivers/clk/sifive/fu740-prci.h
@@ -7,15 +7,6 @@
#ifndef __SIFIVE_CLK_FU740_PRCI_H
#define __SIFIVE_CLK_FU740_PRCI_H
-#include "sifive-prci.h"
-
-#define NUM_CLOCK_FU740 9
-
-extern struct __prci_clock __prci_init_clocks_fu740[NUM_CLOCK_FU740];
-
-static const struct prci_clk_desc prci_clk_fu740 = {
- .clks = __prci_init_clocks_fu740,
- .num_clks = ARRAY_SIZE(__prci_init_clocks_fu740),
-};
+extern struct prci_clk_desc prci_clk_fu740;
#endif /* __SIFIVE_CLK_FU740_PRCI_H */
diff --git a/drivers/clk/sifive/sifive-prci.c b/drivers/clk/sifive/sifive-prci.c
index 80a288c59e56..916d2fc28b9c 100644
--- a/drivers/clk/sifive/sifive-prci.c
+++ b/drivers/clk/sifive/sifive-prci.c
@@ -12,11 +12,6 @@
#include "fu540-prci.h"
#include "fu740-prci.h"
-static const struct prci_clk_desc prci_clk_fu540 = {
- .clks = __prci_init_clocks_fu540,
- .num_clks = ARRAY_SIZE(__prci_init_clocks_fu540),
-};
-
/*
* Private functions
*/
--
2.31.1
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 1/1] clk: sifive: Fix W=1 kernel build warning
2021-12-08 10:06 [PATCH v2 1/1] clk: sifive: Fix W=1 kernel build warning Zong Li
@ 2022-01-05 4:24 ` Zong Li
2022-01-05 23:41 ` Stephen Boyd
2022-01-05 23:40 ` Stephen Boyd
1 sibling, 1 reply; 5+ messages in thread
From: Zong Li @ 2022-01-05 4:24 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Palmer Dabbelt, Paul Walmsley,
lee.jones, linux-clk, linux-riscv
On Wed, Dec 8, 2021 at 6:06 PM Zong Li <zong.li@sifive.com> wrote:
>
> This commit reverts commit 487dc7bb6a0c ("clk: sifive: fu540-prci:
> Declare static const variable 'prci_clk_fu540' where it's used").
> For fixing W=1 kernel build warning(s) about ‘prci_clk_fu540’ defined
> but not used [-Wunused-const-variable=], the problem is that the C file
> of fu540 and fu740 doesn't use these variables, but they includes the
> header files. We could refine the code by moving the definition of these
> variable into fu540 and fu740 implementation respectively, instead of
> common core code, then we could still separate the SoCs-dependent data
> in their own implementation.
>
> Signed-off-by: Zong Li <zong.li@sifive.com>
> ---
> drivers/clk/sifive/fu540-prci.c | 6 +++++-
> drivers/clk/sifive/fu540-prci.h | 6 +-----
> drivers/clk/sifive/fu740-prci.c | 6 +++++-
> drivers/clk/sifive/fu740-prci.h | 11 +----------
> drivers/clk/sifive/sifive-prci.c | 5 -----
> 5 files changed, 12 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/clk/sifive/fu540-prci.c b/drivers/clk/sifive/fu540-prci.c
> index 29bab915003c..5568bc26e36f 100644
> --- a/drivers/clk/sifive/fu540-prci.c
> +++ b/drivers/clk/sifive/fu540-prci.c
> @@ -20,7 +20,6 @@
>
> #include <dt-bindings/clock/sifive-fu540-prci.h>
>
> -#include "fu540-prci.h"
> #include "sifive-prci.h"
>
> /* PRCI integration data for each WRPLL instance */
> @@ -87,3 +86,8 @@ struct __prci_clock __prci_init_clocks_fu540[] = {
> .ops = &sifive_fu540_prci_tlclksel_clk_ops,
> },
> };
> +
> +struct prci_clk_desc prci_clk_fu540 = {
> + .clks = __prci_init_clocks_fu540,
> + .num_clks = ARRAY_SIZE(__prci_init_clocks_fu540),
> +};
> diff --git a/drivers/clk/sifive/fu540-prci.h b/drivers/clk/sifive/fu540-prci.h
> index c220677dc010..931d6cad8c1c 100644
> --- a/drivers/clk/sifive/fu540-prci.h
> +++ b/drivers/clk/sifive/fu540-prci.h
> @@ -7,10 +7,6 @@
> #ifndef __SIFIVE_CLK_FU540_PRCI_H
> #define __SIFIVE_CLK_FU540_PRCI_H
>
> -#include "sifive-prci.h"
> -
> -#define NUM_CLOCK_FU540 4
> -
> -extern struct __prci_clock __prci_init_clocks_fu540[NUM_CLOCK_FU540];
> +extern struct prci_clk_desc prci_clk_fu540;
>
> #endif /* __SIFIVE_CLK_FU540_PRCI_H */
> diff --git a/drivers/clk/sifive/fu740-prci.c b/drivers/clk/sifive/fu740-prci.c
> index 53f6e00a03b9..0ade3dcd24ed 100644
> --- a/drivers/clk/sifive/fu740-prci.c
> +++ b/drivers/clk/sifive/fu740-prci.c
> @@ -8,7 +8,6 @@
>
> #include <dt-bindings/clock/sifive-fu740-prci.h>
>
> -#include "fu540-prci.h"
> #include "sifive-prci.h"
>
> /* PRCI integration data for each WRPLL instance */
> @@ -132,3 +131,8 @@ struct __prci_clock __prci_init_clocks_fu740[] = {
> .ops = &sifive_fu740_prci_pcie_aux_clk_ops,
> },
> };
> +
> +struct prci_clk_desc prci_clk_fu740 = {
> + .clks = __prci_init_clocks_fu740,
> + .num_clks = ARRAY_SIZE(__prci_init_clocks_fu740),
> +};
> diff --git a/drivers/clk/sifive/fu740-prci.h b/drivers/clk/sifive/fu740-prci.h
> index 511a0bf7ba2b..5bc0e18f058c 100644
> --- a/drivers/clk/sifive/fu740-prci.h
> +++ b/drivers/clk/sifive/fu740-prci.h
> @@ -7,15 +7,6 @@
> #ifndef __SIFIVE_CLK_FU740_PRCI_H
> #define __SIFIVE_CLK_FU740_PRCI_H
>
> -#include "sifive-prci.h"
> -
> -#define NUM_CLOCK_FU740 9
> -
> -extern struct __prci_clock __prci_init_clocks_fu740[NUM_CLOCK_FU740];
> -
> -static const struct prci_clk_desc prci_clk_fu740 = {
> - .clks = __prci_init_clocks_fu740,
> - .num_clks = ARRAY_SIZE(__prci_init_clocks_fu740),
> -};
> +extern struct prci_clk_desc prci_clk_fu740;
>
> #endif /* __SIFIVE_CLK_FU740_PRCI_H */
> diff --git a/drivers/clk/sifive/sifive-prci.c b/drivers/clk/sifive/sifive-prci.c
> index 80a288c59e56..916d2fc28b9c 100644
> --- a/drivers/clk/sifive/sifive-prci.c
> +++ b/drivers/clk/sifive/sifive-prci.c
> @@ -12,11 +12,6 @@
> #include "fu540-prci.h"
> #include "fu740-prci.h"
>
> -static const struct prci_clk_desc prci_clk_fu540 = {
> - .clks = __prci_init_clocks_fu540,
> - .num_clks = ARRAY_SIZE(__prci_init_clocks_fu540),
> -};
> -
> /*
> * Private functions
> */
> --
> 2.31.1
>
ping
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 1/1] clk: sifive: Fix W=1 kernel build warning
2021-12-08 10:06 [PATCH v2 1/1] clk: sifive: Fix W=1 kernel build warning Zong Li
2022-01-05 4:24 ` Zong Li
@ 2022-01-05 23:40 ` Stephen Boyd
1 sibling, 0 replies; 5+ messages in thread
From: Stephen Boyd @ 2022-01-05 23:40 UTC (permalink / raw)
To: Zong Li, lee.jones, linux-clk, linux-riscv, mturquette, palmer,
paul.walmsley
Cc: Zong Li
Quoting Zong Li (2021-12-08 02:06:18)
> This commit reverts commit 487dc7bb6a0c ("clk: sifive: fu540-prci:
> Declare static const variable 'prci_clk_fu540' where it's used").
> For fixing W=1 kernel build warning(s) about ‘prci_clk_fu540’ defined
> but not used [-Wunused-const-variable=], the problem is that the C file
> of fu540 and fu740 doesn't use these variables, but they includes the
> header files. We could refine the code by moving the definition of these
> variable into fu540 and fu740 implementation respectively, instead of
> common core code, then we could still separate the SoCs-dependent data
> in their own implementation.
>
> Signed-off-by: Zong Li <zong.li@sifive.com>
> ---
Any Fixes tag?
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 1/1] clk: sifive: Fix W=1 kernel build warning
2022-01-05 4:24 ` Zong Li
@ 2022-01-05 23:41 ` Stephen Boyd
2022-01-06 1:55 ` Zong Li
0 siblings, 1 reply; 5+ messages in thread
From: Stephen Boyd @ 2022-01-05 23:41 UTC (permalink / raw)
To: Michael Turquette, Palmer Dabbelt, Paul Walmsley, Zong Li,
lee.jones, linux-clk, linux-riscv
Quoting Zong Li (2022-01-04 20:24:28)
> On Wed, Dec 8, 2021 at 6:06 PM Zong Li <zong.li@sifive.com> wrote:
> >
> > This commit reverts commit 487dc7bb6a0c ("clk: sifive: fu540-prci:
>
> ping
Please don't send "ping" at the very end of the mail and trim nothing
else. It wastes time.
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 1/1] clk: sifive: Fix W=1 kernel build warning
2022-01-05 23:41 ` Stephen Boyd
@ 2022-01-06 1:55 ` Zong Li
0 siblings, 0 replies; 5+ messages in thread
From: Zong Li @ 2022-01-06 1:55 UTC (permalink / raw)
To: Stephen Boyd
Cc: Michael Turquette, Palmer Dabbelt, Paul Walmsley, lee.jones,
linux-clk, linux-riscv
On Thu, Jan 6, 2022 at 7:41 AM Stephen Boyd <sboyd@kernel.org> wrote:
>
> Quoting Zong Li (2022-01-04 20:24:28)
> > On Wed, Dec 8, 2021 at 6:06 PM Zong Li <zong.li@sifive.com> wrote:
> > >
> > > This commit reverts commit 487dc7bb6a0c ("clk: sifive: fu540-prci:
> >
> > ping
>
> Please don't send "ping" at the very end of the mail and trim nothing
> else. It wastes time.
I got it. Thanks. Let me resend the patch with the change information.
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-01-06 1:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-08 10:06 [PATCH v2 1/1] clk: sifive: Fix W=1 kernel build warning Zong Li
2022-01-05 4:24 ` Zong Li
2022-01-05 23:41 ` Stephen Boyd
2022-01-06 1:55 ` Zong Li
2022-01-05 23:40 ` Stephen Boyd
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).