linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regulator: rt6245: make a const array func_base static, makes object smaller
@ 2021-07-15 14:15 Colin King
  2021-07-15 19:54 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2021-07-15 14:15 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Don't populate the const array func_base on the stack but instead it
static. Makes the object code smaller by 55 bytes:

Before:
   text    data     bss     dec    hex filename
   6422    3216      64    9702   25e6 drivers/regulator/rt6245-regulator.o

After:
   text    data     bss     dec    hex filename
   6303    3280      64    9647   25af drivers/regulator/rt6245-regulator.o

Reduction of 55 bytes

(gcc version 10.3.0)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/regulator/rt6245-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/rt6245-regulator.c b/drivers/regulator/rt6245-regulator.c
index d3299a72fd10..cb22a207e9ff 100644
--- a/drivers/regulator/rt6245-regulator.c
+++ b/drivers/regulator/rt6245-regulator.c
@@ -144,7 +144,7 @@ static int rt6245_init_device_properties(struct device *dev)
 static int rt6245_reg_write(void *context, unsigned int reg, unsigned int val)
 {
 	struct i2c_client *i2c = context;
-	const u8 func_base[] = { 0x6F, 0x73, 0x78, 0x61, 0x7C, 0 };
+	static const u8 func_base[] = { 0x6F, 0x73, 0x78, 0x61, 0x7C, 0 };
 	unsigned int code, bit_count;
 
 	code = func_base[reg];
-- 
2.31.1


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

* Re: [PATCH] regulator: rt6245: make a const array func_base static, makes object smaller
  2021-07-15 14:15 [PATCH] regulator: rt6245: make a const array func_base static, makes object smaller Colin King
@ 2021-07-15 19:54 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2021-07-15 19:54 UTC (permalink / raw)
  To: Colin King, Liam Girdwood; +Cc: Mark Brown, kernel-janitors, linux-kernel

On Thu, 15 Jul 2021 15:15:31 +0100, Colin King wrote:
> Don't populate the const array func_base on the stack but instead it
> static. Makes the object code smaller by 55 bytes:
> 
> Before:
>    text    data     bss     dec    hex filename
>    6422    3216      64    9702   25e6 drivers/regulator/rt6245-regulator.o
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next

Thanks!

[1/1] regulator: rt6245: make a const array func_base static, makes object smaller
      commit: 508f8ccd993d1ff5c9a3092f179f33bd7a825bac

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

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

end of thread, other threads:[~2021-07-15 19:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-15 14:15 [PATCH] regulator: rt6245: make a const array func_base static, makes object smaller Colin King
2021-07-15 19:54 ` Mark Brown

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).