linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/7] clk: Declare mux tables as const u32[]
@ 2022-02-05 10:36 Jonathan Neuschäfer
  2022-02-05 10:36 ` [PATCH v2 1/7] clk: nxp: Remove unused variable Jonathan Neuschäfer
                   ` (7 more replies)
  0 siblings, 8 replies; 18+ messages in thread
From: Jonathan Neuschäfer @ 2022-02-05 10:36 UTC (permalink / raw)
  To: linux-clk; +Cc: linux-arm-kernel, linux-kernel, Jonathan Neuschäfer

I noticed that the 'table' parameter to clk_register_mux_table is never
used for modifying the table elements, and so it can be declared const.

In version 2 I'm addressing two warnings in the clk-lpc18xx-cgu driver
that I previously missed.

Jonathan Neuschäfer (7):
  clk: nxp: Remove unused variable
  clk: nxp: Declare mux table parameter as const u32 *
  clk: mux: Declare u32 *table parameter as const
  clk: hisilicon: Remove unnecessary cast of mux table to u32 *
  clk: mmp: Declare mux tables as const u32[]
  clk: qcom: Declare mux table as const u32[]
  clk: pistachio: Declare mux table as const u32[]

 drivers/clk/clk-mux.c                 | 10 +++++-----
 drivers/clk/hisilicon/clk.c           |  2 +-
 drivers/clk/mmp/clk-of-mmp2.c         |  4 ++--
 drivers/clk/nxp/clk-lpc18xx-cgu.c     |  5 ++---
 drivers/clk/pistachio/clk-pistachio.c |  2 +-
 drivers/clk/qcom/kpss-xcc.c           |  2 +-
 include/linux/clk-provider.h          | 12 ++++++------
 7 files changed, 18 insertions(+), 19 deletions(-)

--
2.34.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v2 1/7] clk: nxp: Remove unused variable
  2022-02-05 10:36 [PATCH v2 0/7] clk: Declare mux tables as const u32[] Jonathan Neuschäfer
@ 2022-02-05 10:36 ` Jonathan Neuschäfer
  2022-02-26  1:00   ` Stephen Boyd
  2022-02-05 10:36 ` [PATCH v2 2/7] clk: nxp: Declare mux table parameter as const u32 * Jonathan Neuschäfer
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: Jonathan Neuschäfer @ 2022-02-05 10:36 UTC (permalink / raw)
  To: linux-clk
  Cc: linux-arm-kernel, linux-kernel, Jonathan Neuschäfer,
	kernel test robot, Michael Turquette, Stephen Boyd,
	Vladimir Zapolskiy, Joachim Eastwood

GCC warns:

> ../drivers/clk/nxp/clk-lpc18xx-cgu.c: In function ‘lpc18xx_pll1_recalc_rate’:
> ../drivers/clk/nxp/clk-lpc18xx-cgu.c:460:13: warning: variable ‘stat’ set but not used [-Wunused-but-set-variable]
>   460 |         u32 stat, ctrl;
>       |             ^~~~

Get rid of the (apparently) useless read from the PLL1_STAT register and
the declaration of stat.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: b04e0b8fd5443 ("clk: add lpc18xx cgu clk driver")
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
---

If the register read is actually useful because of a side-effect, please
speak up.


v2:
- New patch to address this warning
---
 drivers/clk/nxp/clk-lpc18xx-cgu.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/clk/nxp/clk-lpc18xx-cgu.c b/drivers/clk/nxp/clk-lpc18xx-cgu.c
index 8b686da5577b3..349eebf69ed93 100644
--- a/drivers/clk/nxp/clk-lpc18xx-cgu.c
+++ b/drivers/clk/nxp/clk-lpc18xx-cgu.c
@@ -457,9 +457,8 @@ static unsigned long lpc18xx_pll1_recalc_rate(struct clk_hw *hw,
 	struct lpc18xx_pll *pll = to_lpc_pll(hw);
 	u16 msel, nsel, psel;
 	bool direct, fbsel;
-	u32 stat, ctrl;
+	u32 ctrl;

-	stat = readl(pll->reg + LPC18XX_CGU_PLL1_STAT);
 	ctrl = readl(pll->reg + LPC18XX_CGU_PLL1_CTRL);

 	direct = (ctrl & LPC18XX_PLL1_CTRL_DIRECT) ? true : false;
--
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v2 2/7] clk: nxp: Declare mux table parameter as const u32 *
  2022-02-05 10:36 [PATCH v2 0/7] clk: Declare mux tables as const u32[] Jonathan Neuschäfer
  2022-02-05 10:36 ` [PATCH v2 1/7] clk: nxp: Remove unused variable Jonathan Neuschäfer
@ 2022-02-05 10:36 ` Jonathan Neuschäfer
  2022-02-26  1:00   ` Stephen Boyd
  2022-02-05 10:36 ` [PATCH v2 3/7] clk: mux: Declare u32 *table parameter as const Jonathan Neuschäfer
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: Jonathan Neuschäfer @ 2022-02-05 10:36 UTC (permalink / raw)
  To: linux-clk
  Cc: linux-arm-kernel, linux-kernel, Jonathan Neuschäfer,
	Michael Turquette, Stephen Boyd, Vladimir Zapolskiy

lpc18xx_fill_parent_names's "id" parameter isn't used for writing, so
let's make it const.

Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
---

v2:
- New patch
---
 drivers/clk/nxp/clk-lpc18xx-cgu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/nxp/clk-lpc18xx-cgu.c b/drivers/clk/nxp/clk-lpc18xx-cgu.c
index 349eebf69ed93..c23ac463ab0fa 100644
--- a/drivers/clk/nxp/clk-lpc18xx-cgu.c
+++ b/drivers/clk/nxp/clk-lpc18xx-cgu.c
@@ -522,7 +522,7 @@ static struct lpc18xx_cgu_pll_clk lpc18xx_cgu_src_clk_plls[] = {
 	LPC1XX_CGU_CLK_PLL(PLL1,	pll1_src_ids, pll1_ops),
 };

-static void lpc18xx_fill_parent_names(const char **parent, u32 *id, int size)
+static void lpc18xx_fill_parent_names(const char **parent, const u32 *id, int size)
 {
 	int i;

--
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v2 3/7] clk: mux: Declare u32 *table parameter as const
  2022-02-05 10:36 [PATCH v2 0/7] clk: Declare mux tables as const u32[] Jonathan Neuschäfer
  2022-02-05 10:36 ` [PATCH v2 1/7] clk: nxp: Remove unused variable Jonathan Neuschäfer
  2022-02-05 10:36 ` [PATCH v2 2/7] clk: nxp: Declare mux table parameter as const u32 * Jonathan Neuschäfer
@ 2022-02-05 10:36 ` Jonathan Neuschäfer
  2022-02-26  1:01   ` Stephen Boyd
  2022-02-05 10:36 ` [PATCH v2 4/7] clk: hisilicon: Remove unnecessary cast of mux table to u32 * Jonathan Neuschäfer
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: Jonathan Neuschäfer @ 2022-02-05 10:36 UTC (permalink / raw)
  To: linux-clk
  Cc: linux-arm-kernel, linux-kernel, Jonathan Neuschäfer,
	Michael Turquette, Stephen Boyd

The elements of the table are never modified in clk-mux.c. To make this
clear to clock drivers, declare the parameter as const u32 *table.

Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
---

v2:
- no changes
---
 drivers/clk/clk-mux.c        | 10 +++++-----
 include/linux/clk-provider.h | 12 ++++++------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c
index 20582aae7a35f..214045f6e9895 100644
--- a/drivers/clk/clk-mux.c
+++ b/drivers/clk/clk-mux.c
@@ -40,7 +40,7 @@ static inline void clk_mux_writel(struct clk_mux *mux, u32 val)
 		writel(val, mux->reg);
 }

-int clk_mux_val_to_index(struct clk_hw *hw, u32 *table, unsigned int flags,
+int clk_mux_val_to_index(struct clk_hw *hw, const u32 *table, unsigned int flags,
 			 unsigned int val)
 {
 	int num_parents = clk_hw_get_num_parents(hw);
@@ -67,7 +67,7 @@ int clk_mux_val_to_index(struct clk_hw *hw, u32 *table, unsigned int flags,
 }
 EXPORT_SYMBOL_GPL(clk_mux_val_to_index);

-unsigned int clk_mux_index_to_val(u32 *table, unsigned int flags, u8 index)
+unsigned int clk_mux_index_to_val(const u32 *table, unsigned int flags, u8 index)
 {
 	unsigned int val = index;

@@ -152,7 +152,7 @@ struct clk_hw *__clk_hw_register_mux(struct device *dev, struct device_node *np,
 		const struct clk_hw **parent_hws,
 		const struct clk_parent_data *parent_data,
 		unsigned long flags, void __iomem *reg, u8 shift, u32 mask,
-		u8 clk_mux_flags, u32 *table, spinlock_t *lock)
+		u8 clk_mux_flags, const u32 *table, spinlock_t *lock)
 {
 	struct clk_mux *mux;
 	struct clk_hw *hw;
@@ -218,7 +218,7 @@ struct clk_hw *__devm_clk_hw_register_mux(struct device *dev, struct device_node
 		const struct clk_hw **parent_hws,
 		const struct clk_parent_data *parent_data,
 		unsigned long flags, void __iomem *reg, u8 shift, u32 mask,
-		u8 clk_mux_flags, u32 *table, spinlock_t *lock)
+		u8 clk_mux_flags, const u32 *table, spinlock_t *lock)
 {
 	struct clk_hw **ptr, *hw;

@@ -244,7 +244,7 @@ EXPORT_SYMBOL_GPL(__devm_clk_hw_register_mux);
 struct clk *clk_register_mux_table(struct device *dev, const char *name,
 		const char * const *parent_names, u8 num_parents,
 		unsigned long flags, void __iomem *reg, u8 shift, u32 mask,
-		u8 clk_mux_flags, u32 *table, spinlock_t *lock)
+		u8 clk_mux_flags, const u32 *table, spinlock_t *lock)
 {
 	struct clk_hw *hw;

diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 2faa6f7aa8a87..27be575288747 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -888,7 +888,7 @@ void clk_hw_unregister_divider(struct clk_hw *hw);
 struct clk_mux {
 	struct clk_hw	hw;
 	void __iomem	*reg;
-	u32		*table;
+	const u32	*table;
 	u32		mask;
 	u8		shift;
 	u8		flags;
@@ -913,18 +913,18 @@ struct clk_hw *__clk_hw_register_mux(struct device *dev, struct device_node *np,
 		const struct clk_hw **parent_hws,
 		const struct clk_parent_data *parent_data,
 		unsigned long flags, void __iomem *reg, u8 shift, u32 mask,
-		u8 clk_mux_flags, u32 *table, spinlock_t *lock);
+		u8 clk_mux_flags, const u32 *table, spinlock_t *lock);
 struct clk_hw *__devm_clk_hw_register_mux(struct device *dev, struct device_node *np,
 		const char *name, u8 num_parents,
 		const char * const *parent_names,
 		const struct clk_hw **parent_hws,
 		const struct clk_parent_data *parent_data,
 		unsigned long flags, void __iomem *reg, u8 shift, u32 mask,
-		u8 clk_mux_flags, u32 *table, spinlock_t *lock);
+		u8 clk_mux_flags, const u32 *table, spinlock_t *lock);
 struct clk *clk_register_mux_table(struct device *dev, const char *name,
 		const char * const *parent_names, u8 num_parents,
 		unsigned long flags, void __iomem *reg, u8 shift, u32 mask,
-		u8 clk_mux_flags, u32 *table, spinlock_t *lock);
+		u8 clk_mux_flags, const u32 *table, spinlock_t *lock);

 #define clk_register_mux(dev, name, parent_names, num_parents, flags, reg,    \
 			 shift, width, clk_mux_flags, lock)		      \
@@ -962,9 +962,9 @@ struct clk *clk_register_mux_table(struct device *dev, const char *name,
 			      (shift), BIT((width)) - 1, (clk_mux_flags),     \
 			      NULL, (lock))

-int clk_mux_val_to_index(struct clk_hw *hw, u32 *table, unsigned int flags,
+int clk_mux_val_to_index(struct clk_hw *hw, const u32 *table, unsigned int flags,
 			 unsigned int val);
-unsigned int clk_mux_index_to_val(u32 *table, unsigned int flags, u8 index);
+unsigned int clk_mux_index_to_val(const u32 *table, unsigned int flags, u8 index);

 void clk_unregister_mux(struct clk *clk);
 void clk_hw_unregister_mux(struct clk_hw *hw);
--
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v2 4/7] clk: hisilicon: Remove unnecessary cast of mux table to u32 *
  2022-02-05 10:36 [PATCH v2 0/7] clk: Declare mux tables as const u32[] Jonathan Neuschäfer
                   ` (2 preceding siblings ...)
  2022-02-05 10:36 ` [PATCH v2 3/7] clk: mux: Declare u32 *table parameter as const Jonathan Neuschäfer
@ 2022-02-05 10:36 ` Jonathan Neuschäfer
  2022-02-26  1:01   ` Stephen Boyd
  2022-02-05 10:36 ` [PATCH v2 5/7] clk: mmp: Declare mux tables as const u32[] Jonathan Neuschäfer
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: Jonathan Neuschäfer @ 2022-02-05 10:36 UTC (permalink / raw)
  To: linux-clk
  Cc: linux-arm-kernel, linux-kernel, Jonathan Neuschäfer,
	Michael Turquette, Stephen Boyd, Dongjiu Geng

Now that clk_register_mux_table takes a const u32 *, we don't need the
cast anymore.

Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
---

v2:
- no changes
---
 drivers/clk/hisilicon/clk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/hisilicon/clk.c b/drivers/clk/hisilicon/clk.c
index 9361fba7cd4cf..54d9fdc935990 100644
--- a/drivers/clk/hisilicon/clk.c
+++ b/drivers/clk/hisilicon/clk.c
@@ -162,7 +162,7 @@ int hisi_clk_register_mux(const struct hisi_mux_clock *clks,
 					clks[i].num_parents, clks[i].flags,
 					base + clks[i].offset, clks[i].shift,
 					mask, clks[i].mux_flags,
-					(u32 *)clks[i].table, &hisi_clk_lock);
+					clks[i].table, &hisi_clk_lock);
 		if (IS_ERR(clk)) {
 			pr_err("%s: failed to register clock %s\n",
 			       __func__, clks[i].name);
--
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v2 5/7] clk: mmp: Declare mux tables as const u32[]
  2022-02-05 10:36 [PATCH v2 0/7] clk: Declare mux tables as const u32[] Jonathan Neuschäfer
                   ` (3 preceding siblings ...)
  2022-02-05 10:36 ` [PATCH v2 4/7] clk: hisilicon: Remove unnecessary cast of mux table to u32 * Jonathan Neuschäfer
@ 2022-02-05 10:36 ` Jonathan Neuschäfer
  2022-02-26  1:01   ` Stephen Boyd
  2022-02-05 10:36 ` [PATCH v2 6/7] clk: qcom: Declare mux table " Jonathan Neuschäfer
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: Jonathan Neuschäfer @ 2022-02-05 10:36 UTC (permalink / raw)
  To: linux-clk
  Cc: linux-arm-kernel, linux-kernel, Jonathan Neuschäfer,
	Michael Turquette, Stephen Boyd

Now that clk_register_mux_table takes a const u32 *, we can declare the
mux tables as const u32[].

Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
---

v2:
- no changes
---
 drivers/clk/mmp/clk-of-mmp2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/mmp/clk-of-mmp2.c b/drivers/clk/mmp/clk-of-mmp2.c
index 0839fb2049e94..50a780274ba0c 100644
--- a/drivers/clk/mmp/clk-of-mmp2.c
+++ b/drivers/clk/mmp/clk-of-mmp2.c
@@ -317,9 +317,9 @@ static const char * const ccic_parent_names[] = {"pll1_2", "pll1_16", "vctcxo"};

 static DEFINE_SPINLOCK(gpu_lock);
 static const char * const mmp2_gpu_gc_parent_names[] =  {"pll1_2", "pll1_3", "pll2_2", "pll2_3", "pll2", "usb_pll"};
-static u32 mmp2_gpu_gc_parent_table[] =          { 0x0000,   0x0040,   0x0080,   0x00c0,   0x1000, 0x1040   };
+static const u32 mmp2_gpu_gc_parent_table[] = { 0x0000,   0x0040,   0x0080,   0x00c0,   0x1000, 0x1040   };
 static const char * const mmp2_gpu_bus_parent_names[] = {"pll1_4", "pll2",   "pll2_2", "usb_pll"};
-static u32 mmp2_gpu_bus_parent_table[] =         { 0x0000,   0x0020,   0x0030,   0x4020   };
+static const u32 mmp2_gpu_bus_parent_table[] = { 0x0000,   0x0020,   0x0030,   0x4020   };
 static const char * const mmp3_gpu_bus_parent_names[] = {"pll1_4", "pll1_6", "pll1_2", "pll2_2"};
 static const char * const mmp3_gpu_gc_parent_names[] =  {"pll1",   "pll2",   "pll1_p", "pll2_p"};

--
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v2 6/7] clk: qcom: Declare mux table as const u32[]
  2022-02-05 10:36 [PATCH v2 0/7] clk: Declare mux tables as const u32[] Jonathan Neuschäfer
                   ` (4 preceding siblings ...)
  2022-02-05 10:36 ` [PATCH v2 5/7] clk: mmp: Declare mux tables as const u32[] Jonathan Neuschäfer
@ 2022-02-05 10:36 ` Jonathan Neuschäfer
  2022-02-26  1:02   ` Stephen Boyd
  2022-02-05 10:36 ` [PATCH v2 7/7] clk: pistachio: " Jonathan Neuschäfer
  2022-02-26  1:00 ` [PATCH v2 0/7] clk: Declare mux tables " Stephen Boyd
  7 siblings, 1 reply; 18+ messages in thread
From: Jonathan Neuschäfer @ 2022-02-05 10:36 UTC (permalink / raw)
  To: linux-clk
  Cc: linux-arm-kernel, linux-kernel, Jonathan Neuschäfer,
	Bjorn Andersson, Andy Gross, Michael Turquette, Stephen Boyd,
	linux-arm-msm

Now that clk_register_mux_table takes a const u32 *, we can declare the
mux tables as const u32[].

Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
---

v2:
- no changes
---
 drivers/clk/qcom/kpss-xcc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/qcom/kpss-xcc.c b/drivers/clk/qcom/kpss-xcc.c
index 4fec1f9142b82..88d4b33ac0cc3 100644
--- a/drivers/clk/qcom/kpss-xcc.c
+++ b/drivers/clk/qcom/kpss-xcc.c
@@ -17,7 +17,7 @@ static const char *aux_parents[] = {
 	"pxo",
 };

-static unsigned int aux_parent_map[] = {
+static const u32 aux_parent_map[] = {
 	3,
 	0,
 };
--
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v2 7/7] clk: pistachio: Declare mux table as const u32[]
  2022-02-05 10:36 [PATCH v2 0/7] clk: Declare mux tables as const u32[] Jonathan Neuschäfer
                   ` (5 preceding siblings ...)
  2022-02-05 10:36 ` [PATCH v2 6/7] clk: qcom: Declare mux table " Jonathan Neuschäfer
@ 2022-02-05 10:36 ` Jonathan Neuschäfer
  2022-02-26  1:02   ` Stephen Boyd
  2022-02-26  1:00 ` [PATCH v2 0/7] clk: Declare mux tables " Stephen Boyd
  7 siblings, 1 reply; 18+ messages in thread
From: Jonathan Neuschäfer @ 2022-02-05 10:36 UTC (permalink / raw)
  To: linux-clk
  Cc: linux-arm-kernel, linux-kernel, Jonathan Neuschäfer,
	Michael Turquette, Stephen Boyd

Now that clk_register_mux_table takes a const u32 *, we can declare the
mux table as const u32[].

Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
---

v2:
- no changes
---
 drivers/clk/pistachio/clk-pistachio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/pistachio/clk-pistachio.c b/drivers/clk/pistachio/clk-pistachio.c
index 76f492c7e917e..2a6d583237dc7 100644
--- a/drivers/clk/pistachio/clk-pistachio.c
+++ b/drivers/clk/pistachio/clk-pistachio.c
@@ -154,7 +154,7 @@ static struct pistachio_pll pistachio_plls[] __initdata = {
 PNAME(mux_debug) = { "mips_pll_mux", "rpu_v_pll_mux",
 		     "rpu_l_pll_mux", "sys_pll_mux",
 		     "wifi_pll_mux", "bt_pll_mux" };
-static u32 mux_debug_idx[] = { 0x0, 0x1, 0x2, 0x4, 0x8, 0x10 };
+static const u32 mux_debug_idx[] = { 0x0, 0x1, 0x2, 0x4, 0x8, 0x10 };

 static unsigned int pistachio_critical_clks_core[] __initdata = {
 	CLK_MIPS
--
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH v2 0/7] clk: Declare mux tables as const u32[]
  2022-02-05 10:36 [PATCH v2 0/7] clk: Declare mux tables as const u32[] Jonathan Neuschäfer
                   ` (6 preceding siblings ...)
  2022-02-05 10:36 ` [PATCH v2 7/7] clk: pistachio: " Jonathan Neuschäfer
@ 2022-02-26  1:00 ` Stephen Boyd
  2022-02-26 12:40   ` Jonathan Neuschäfer
  7 siblings, 1 reply; 18+ messages in thread
From: Stephen Boyd @ 2022-02-26  1:00 UTC (permalink / raw)
  To: Jonathan Neuschäfer, linux-clk
  Cc: linux-arm-kernel, linux-kernel, Jonathan Neuschäfer

Quoting Jonathan Neuschäfer (2022-02-05 02:36:06)
> I noticed that the 'table' parameter to clk_register_mux_table is never
> used for modifying the table elements, and so it can be declared const.
> 
> In version 2 I'm addressing two warnings in the clk-lpc18xx-cgu driver
> that I previously missed.

The format of these patches deeply confused my scripts that use git
interpret-trailer. I fixed it now, hopefully it keeps working. In the
future, please don't add more triple dash '---' sections to the patch.
It looks like those extra sections for the changelog messed everything
up. Or there's a new bug in interpret-trailers.  Either way,
interpret-trailers was adding tags after the entire patch contents
because I think it looks for the last triple dash instead of the first
triple dash. Not sure why it's done that way. I resorted to
reconstructing the patch after splitting it with mailinfo.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v2 1/7] clk: nxp: Remove unused variable
  2022-02-05 10:36 ` [PATCH v2 1/7] clk: nxp: Remove unused variable Jonathan Neuschäfer
@ 2022-02-26  1:00   ` Stephen Boyd
  0 siblings, 0 replies; 18+ messages in thread
From: Stephen Boyd @ 2022-02-26  1:00 UTC (permalink / raw)
  To: Jonathan Neuschäfer, linux-clk
  Cc: linux-arm-kernel, linux-kernel, Jonathan Neuschäfer,
	kernel test robot, Michael Turquette, Vladimir Zapolskiy,
	Joachim Eastwood

Quoting Jonathan Neuschäfer (2022-02-05 02:36:07)
> GCC warns:
> 
> > ../drivers/clk/nxp/clk-lpc18xx-cgu.c: In function ‘lpc18xx_pll1_recalc_rate’:
> > ../drivers/clk/nxp/clk-lpc18xx-cgu.c:460:13: warning: variable ‘stat’ set but not used [-Wunused-but-set-variable]
> >   460 |         u32 stat, ctrl;
> >       |             ^~~~
> 
> Get rid of the (apparently) useless read from the PLL1_STAT register and
> the declaration of stat.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Fixes: b04e0b8fd5443 ("clk: add lpc18xx cgu clk driver")
> Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
> ---

Applied to clk-next

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v2 2/7] clk: nxp: Declare mux table parameter as const u32 *
  2022-02-05 10:36 ` [PATCH v2 2/7] clk: nxp: Declare mux table parameter as const u32 * Jonathan Neuschäfer
@ 2022-02-26  1:00   ` Stephen Boyd
  0 siblings, 0 replies; 18+ messages in thread
From: Stephen Boyd @ 2022-02-26  1:00 UTC (permalink / raw)
  To: Jonathan Neuschäfer, linux-clk
  Cc: linux-arm-kernel, linux-kernel, Jonathan Neuschäfer,
	Michael Turquette, Vladimir Zapolskiy

Quoting Jonathan Neuschäfer (2022-02-05 02:36:08)
> lpc18xx_fill_parent_names's "id" parameter isn't used for writing, so
> let's make it const.
> 
> Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
> ---

Applied to clk-next

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v2 3/7] clk: mux: Declare u32 *table parameter as const
  2022-02-05 10:36 ` [PATCH v2 3/7] clk: mux: Declare u32 *table parameter as const Jonathan Neuschäfer
@ 2022-02-26  1:01   ` Stephen Boyd
  0 siblings, 0 replies; 18+ messages in thread
From: Stephen Boyd @ 2022-02-26  1:01 UTC (permalink / raw)
  To: Jonathan Neuschäfer, linux-clk
  Cc: linux-arm-kernel, linux-kernel, Jonathan Neuschäfer,
	Michael Turquette

Quoting Jonathan Neuschäfer (2022-02-05 02:36:09)
> The elements of the table are never modified in clk-mux.c. To make this
> clear to clock drivers, declare the parameter as const u32 *table.
> 
> Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
> ---

Applied to clk-next

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v2 4/7] clk: hisilicon: Remove unnecessary cast of mux table to u32 *
  2022-02-05 10:36 ` [PATCH v2 4/7] clk: hisilicon: Remove unnecessary cast of mux table to u32 * Jonathan Neuschäfer
@ 2022-02-26  1:01   ` Stephen Boyd
  0 siblings, 0 replies; 18+ messages in thread
From: Stephen Boyd @ 2022-02-26  1:01 UTC (permalink / raw)
  To: Jonathan Neuschäfer, linux-clk
  Cc: linux-arm-kernel, linux-kernel, Jonathan Neuschäfer,
	Michael Turquette, Dongjiu Geng

Quoting Jonathan Neuschäfer (2022-02-05 02:36:10)
> Now that clk_register_mux_table takes a const u32 *, we don't need the
> cast anymore.
> 
> Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
> ---

Applied to clk-next

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v2 5/7] clk: mmp: Declare mux tables as const u32[]
  2022-02-05 10:36 ` [PATCH v2 5/7] clk: mmp: Declare mux tables as const u32[] Jonathan Neuschäfer
@ 2022-02-26  1:01   ` Stephen Boyd
  0 siblings, 0 replies; 18+ messages in thread
From: Stephen Boyd @ 2022-02-26  1:01 UTC (permalink / raw)
  To: Jonathan Neuschäfer, linux-clk
  Cc: linux-arm-kernel, linux-kernel, Jonathan Neuschäfer,
	Michael Turquette

Quoting Jonathan Neuschäfer (2022-02-05 02:36:11)
> Now that clk_register_mux_table takes a const u32 *, we can declare the
> mux tables as const u32[].
> 
> Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
> ---

Applied to clk-next

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v2 6/7] clk: qcom: Declare mux table as const u32[]
  2022-02-05 10:36 ` [PATCH v2 6/7] clk: qcom: Declare mux table " Jonathan Neuschäfer
@ 2022-02-26  1:02   ` Stephen Boyd
  0 siblings, 0 replies; 18+ messages in thread
From: Stephen Boyd @ 2022-02-26  1:02 UTC (permalink / raw)
  To: Jonathan Neuschäfer, linux-clk
  Cc: linux-arm-kernel, linux-kernel, Jonathan Neuschäfer,
	Bjorn Andersson, Andy Gross, Michael Turquette, linux-arm-msm

Quoting Jonathan Neuschäfer (2022-02-05 02:36:12)
> Now that clk_register_mux_table takes a const u32 *, we can declare the
> mux tables as const u32[].
> 
> Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
> ---

Applied to clk-next

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v2 7/7] clk: pistachio: Declare mux table as const u32[]
  2022-02-05 10:36 ` [PATCH v2 7/7] clk: pistachio: " Jonathan Neuschäfer
@ 2022-02-26  1:02   ` Stephen Boyd
  0 siblings, 0 replies; 18+ messages in thread
From: Stephen Boyd @ 2022-02-26  1:02 UTC (permalink / raw)
  To: Jonathan Neuschäfer, linux-clk
  Cc: linux-arm-kernel, linux-kernel, Jonathan Neuschäfer,
	Michael Turquette

Quoting Jonathan Neuschäfer (2022-02-05 02:36:13)
> Now that clk_register_mux_table takes a const u32 *, we can declare the
> mux table as const u32[].
> 
> Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
> ---

Applied to clk-next

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v2 0/7] clk: Declare mux tables as const u32[]
  2022-02-26  1:00 ` [PATCH v2 0/7] clk: Declare mux tables " Stephen Boyd
@ 2022-02-26 12:40   ` Jonathan Neuschäfer
  2022-03-12  2:33     ` Stephen Boyd
  0 siblings, 1 reply; 18+ messages in thread
From: Jonathan Neuschäfer @ 2022-02-26 12:40 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Jonathan Neuschäfer, linux-clk, linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1422 bytes --]

On Fri, Feb 25, 2022 at 05:00:31PM -0800, Stephen Boyd wrote:
> Quoting Jonathan Neuschäfer (2022-02-05 02:36:06)
> > I noticed that the 'table' parameter to clk_register_mux_table is never
> > used for modifying the table elements, and so it can be declared const.
> > 
> > In version 2 I'm addressing two warnings in the clk-lpc18xx-cgu driver
> > that I previously missed.
> 
> The format of these patches deeply confused my scripts that use git
> interpret-trailer. I fixed it now, hopefully it keeps working. In the
> future, please don't add more triple dash '---' sections to the patch.
> It looks like those extra sections for the changelog messed everything
> up. Or there's a new bug in interpret-trailers.  Either way,
> interpret-trailers was adding tags after the entire patch contents
> because I think it looks for the last triple dash instead of the first
> triple dash. Not sure why it's done that way. I resorted to
> reconstructing the patch after splitting it with mailinfo.

Hmm, sorry about that.

I've used this format for a while, because it conveniently lets me
keep my remarks in a git commit (rather than a patch file), until I use
git format-patch to generate the final patch file.

I'm not very familiar with git interpret-trailers, but git 2.34.1
doesn't seem to get confused on my patches (or I didn't pass the right
options to cause it to happen).


Jonathan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v2 0/7] clk: Declare mux tables as const u32[]
  2022-02-26 12:40   ` Jonathan Neuschäfer
@ 2022-03-12  2:33     ` Stephen Boyd
  0 siblings, 0 replies; 18+ messages in thread
From: Stephen Boyd @ 2022-03-12  2:33 UTC (permalink / raw)
  To: Jonathan Neuschäfer
  Cc: Jonathan Neuschäfer, linux-clk, linux-arm-kernel, linux-kernel

Quoting Jonathan Neuschäfer (2022-02-26 04:40:19)
> On Fri, Feb 25, 2022 at 05:00:31PM -0800, Stephen Boyd wrote:
> > Quoting Jonathan Neuschäfer (2022-02-05 02:36:06)
> > > I noticed that the 'table' parameter to clk_register_mux_table is never
> > > used for modifying the table elements, and so it can be declared const.
> > > 
> > > In version 2 I'm addressing two warnings in the clk-lpc18xx-cgu driver
> > > that I previously missed.
> > 
> > The format of these patches deeply confused my scripts that use git
> > interpret-trailer. I fixed it now, hopefully it keeps working. In the
> > future, please don't add more triple dash '---' sections to the patch.
> > It looks like those extra sections for the changelog messed everything
> > up. Or there's a new bug in interpret-trailers.  Either way,
> > interpret-trailers was adding tags after the entire patch contents
> > because I think it looks for the last triple dash instead of the first
> > triple dash. Not sure why it's done that way. I resorted to
> > reconstructing the patch after splitting it with mailinfo.
> 
> Hmm, sorry about that.
> 
> I've used this format for a while, because it conveniently lets me
> keep my remarks in a git commit (rather than a patch file), until I use
> git format-patch to generate the final patch file.
> 
> I'm not very familiar with git interpret-trailers, but git 2.34.1
> doesn't seem to get confused on my patches (or I didn't pass the right
> options to cause it to happen).
> 

It's possible it's a git bug. No worries!

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2022-03-12  2:33 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-05 10:36 [PATCH v2 0/7] clk: Declare mux tables as const u32[] Jonathan Neuschäfer
2022-02-05 10:36 ` [PATCH v2 1/7] clk: nxp: Remove unused variable Jonathan Neuschäfer
2022-02-26  1:00   ` Stephen Boyd
2022-02-05 10:36 ` [PATCH v2 2/7] clk: nxp: Declare mux table parameter as const u32 * Jonathan Neuschäfer
2022-02-26  1:00   ` Stephen Boyd
2022-02-05 10:36 ` [PATCH v2 3/7] clk: mux: Declare u32 *table parameter as const Jonathan Neuschäfer
2022-02-26  1:01   ` Stephen Boyd
2022-02-05 10:36 ` [PATCH v2 4/7] clk: hisilicon: Remove unnecessary cast of mux table to u32 * Jonathan Neuschäfer
2022-02-26  1:01   ` Stephen Boyd
2022-02-05 10:36 ` [PATCH v2 5/7] clk: mmp: Declare mux tables as const u32[] Jonathan Neuschäfer
2022-02-26  1:01   ` Stephen Boyd
2022-02-05 10:36 ` [PATCH v2 6/7] clk: qcom: Declare mux table " Jonathan Neuschäfer
2022-02-26  1:02   ` Stephen Boyd
2022-02-05 10:36 ` [PATCH v2 7/7] clk: pistachio: " Jonathan Neuschäfer
2022-02-26  1:02   ` Stephen Boyd
2022-02-26  1:00 ` [PATCH v2 0/7] clk: Declare mux tables " Stephen Boyd
2022-02-26 12:40   ` Jonathan Neuschäfer
2022-03-12  2:33     ` 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).