* [PATCH 1/1] clk: sifive: Fix W=1 kernel build warning
@ 2021-12-08 2:04 Zong Li
2021-12-08 8:31 ` Andreas Schwab
0 siblings, 1 reply; 3+ messages in thread
From: Zong Li @ 2021-12-08 2:04 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=], we should just remove the
header including in fu540 and fu740 implementation respectively,
because they don't actually use these static variables. After that,
we could still separate SoCs-dependent data in their own defination,
rather than put it in the common core code.
Signed-off-by: Zong Li <zong.li@sifive.com>
---
drivers/clk/sifive/fu540-prci.c | 1 -
drivers/clk/sifive/fu540-prci.h | 5 +++++
drivers/clk/sifive/fu740-prci.c | 1 -
drivers/clk/sifive/sifive-prci.c | 5 -----
4 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/clk/sifive/fu540-prci.c b/drivers/clk/sifive/fu540-prci.c
index 29bab915003c..40ee5ab1748d 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 */
diff --git a/drivers/clk/sifive/fu540-prci.h b/drivers/clk/sifive/fu540-prci.h
index c220677dc010..c8271efa7bdc 100644
--- a/drivers/clk/sifive/fu540-prci.h
+++ b/drivers/clk/sifive/fu540-prci.h
@@ -13,4 +13,9 @@
extern struct __prci_clock __prci_init_clocks_fu540[NUM_CLOCK_FU540];
+static const struct prci_clk_desc prci_clk_fu540 = {
+ .clks = __prci_init_clocks_fu540,
+ .num_clks = ARRAY_SIZE(__prci_init_clocks_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..e1da4eec0786 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 */
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
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH 1/1] clk: sifive: Fix W=1 kernel build warning
2021-12-08 2:04 [PATCH 1/1] clk: sifive: Fix W=1 kernel build warning Zong Li
@ 2021-12-08 8:31 ` Andreas Schwab
2021-12-08 9:22 ` Zong Li
0 siblings, 1 reply; 3+ messages in thread
From: Andreas Schwab @ 2021-12-08 8:31 UTC (permalink / raw)
To: Zong Li
Cc: mturquette, sboyd, palmer, paul.walmsley, lee.jones, linux-clk,
linux-riscv
On Dez 08 2021, Zong Li wrote:
> diff --git a/drivers/clk/sifive/fu540-prci.h b/drivers/clk/sifive/fu540-prci.h
> index c220677dc010..c8271efa7bdc 100644
> --- a/drivers/clk/sifive/fu540-prci.h
> +++ b/drivers/clk/sifive/fu540-prci.h
> @@ -13,4 +13,9 @@
>
> extern struct __prci_clock __prci_init_clocks_fu540[NUM_CLOCK_FU540];
>
> +static const struct prci_clk_desc prci_clk_fu540 = {
> + .clks = __prci_init_clocks_fu540,
> + .num_clks = ARRAY_SIZE(__prci_init_clocks_fu540),
> +};
> +
A header should only declare things, not define them.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH 1/1] clk: sifive: Fix W=1 kernel build warning
2021-12-08 8:31 ` Andreas Schwab
@ 2021-12-08 9:22 ` Zong Li
0 siblings, 0 replies; 3+ messages in thread
From: Zong Li @ 2021-12-08 9:22 UTC (permalink / raw)
To: Andreas Schwab
Cc: Michael Turquette, Stephen Boyd, Palmer Dabbelt, Paul Walmsley,
lee.jones, linux-clk, linux-riscv
On Wed, Dec 8, 2021 at 4:31 PM Andreas Schwab <schwab@linux-m68k.org> wrote:
>
> On Dez 08 2021, Zong Li wrote:
>
> > diff --git a/drivers/clk/sifive/fu540-prci.h b/drivers/clk/sifive/fu540-prci.h
> > index c220677dc010..c8271efa7bdc 100644
> > --- a/drivers/clk/sifive/fu540-prci.h
> > +++ b/drivers/clk/sifive/fu540-prci.h
> > @@ -13,4 +13,9 @@
> >
> > extern struct __prci_clock __prci_init_clocks_fu540[NUM_CLOCK_FU540];
> >
> > +static const struct prci_clk_desc prci_clk_fu540 = {
> > + .clks = __prci_init_clocks_fu540,
> > + .num_clks = ARRAY_SIZE(__prci_init_clocks_fu540),
> > +};
> > +
>
> A header should only declare things, not define them.
>
oh yes, let me move them to fu540/fu740-prci.c respectively, thanks.
> Andreas.
>
> --
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
> "And now for something completely different."
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-12-08 9:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-08 2:04 [PATCH 1/1] clk: sifive: Fix W=1 kernel build warning Zong Li
2021-12-08 8:31 ` Andreas Schwab
2021-12-08 9:22 ` Zong Li
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox