linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: bcm2835: Constify struct debugfs_reg32
@ 2020-05-08 22:02 Rikard Falkeborn
  2020-05-27  7:10 ` Stephen Boyd
  0 siblings, 1 reply; 2+ messages in thread
From: Rikard Falkeborn @ 2020-05-08 22:02 UTC (permalink / raw)
  To: mturquette, sboyd, nsaenzjulienne, f.fainelli, rjui, sbranden,
	eric, wahrenst
  Cc: bcm-kernel-feedback-list, linux-clk, linux-rpi-kernel,
	linux-arm-kernel, linux-kernel, Rikard Falkeborn

bcm2835_debugfs_clock_reg32 is never changed and can therefore be made
const.

This allows the compiler to put it in the text section instead of the
data section.

Before:
   text    data     bss     dec     hex filename
  26598   16088      64   42750    a6fe drivers/clk/bcm/clk-bcm2835.o

After:
   text    data     bss     dec     hex filename
  26662   16024      64   42750    a6fe drivers/clk/bcm/clk-bcm2835.o

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/clk/bcm/clk-bcm2835.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c
index ded13ccf768e..7da3b1ba1377 100644
--- a/drivers/clk/bcm/clk-bcm2835.c
+++ b/drivers/clk/bcm/clk-bcm2835.c
@@ -396,8 +396,8 @@ static unsigned long bcm2835_measure_tcnt_mux(struct bcm2835_cprman *cprman,
 }
 
 static void bcm2835_debugfs_regset(struct bcm2835_cprman *cprman, u32 base,
-				  struct debugfs_reg32 *regs, size_t nregs,
-				  struct dentry *dentry)
+				   const struct debugfs_reg32 *regs,
+				   size_t nregs, struct dentry *dentry)
 {
 	struct debugfs_regset32 *regset;
 
@@ -1240,7 +1240,7 @@ static u8 bcm2835_clock_get_parent(struct clk_hw *hw)
 	return (src & CM_SRC_MASK) >> CM_SRC_SHIFT;
 }
 
-static struct debugfs_reg32 bcm2835_debugfs_clock_reg32[] = {
+static const struct debugfs_reg32 bcm2835_debugfs_clock_reg32[] = {
 	{
 		.name = "ctl",
 		.offset = 0,
-- 
2.26.2


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

* Re: [PATCH] clk: bcm2835: Constify struct debugfs_reg32
  2020-05-08 22:02 [PATCH] clk: bcm2835: Constify struct debugfs_reg32 Rikard Falkeborn
@ 2020-05-27  7:10 ` Stephen Boyd
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2020-05-27  7:10 UTC (permalink / raw)
  To: Rikard Falkeborn, eric, f.fainelli, mturquette, nsaenzjulienne,
	rjui, sbranden, wahrenst
  Cc: bcm-kernel-feedback-list, linux-clk, linux-rpi-kernel,
	linux-arm-kernel, linux-kernel, Rikard Falkeborn

Quoting Rikard Falkeborn (2020-05-08 15:02:38)
> bcm2835_debugfs_clock_reg32 is never changed and can therefore be made
> const.
> 
> This allows the compiler to put it in the text section instead of the
> data section.
> 
> Before:
>    text    data     bss     dec     hex filename
>   26598   16088      64   42750    a6fe drivers/clk/bcm/clk-bcm2835.o
> 
> After:
>    text    data     bss     dec     hex filename
>   26662   16024      64   42750    a6fe drivers/clk/bcm/clk-bcm2835.o
> 
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
> ---

Applied to clk-next

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

end of thread, other threads:[~2020-05-27  7:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08 22:02 [PATCH] clk: bcm2835: Constify struct debugfs_reg32 Rikard Falkeborn
2020-05-27  7:10 ` 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).