kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] memory: tegra: make the array list static const, makes object smaller
@ 2021-08-19 13:31 Colin King
  2021-08-19 17:26 ` Thierry Reding
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Colin King @ 2021-08-19 13:31 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Thierry Reding, Jonathan Hunter, linux-kernel
  Cc: kernel-janitors, linux-tegra

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

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

Before:
   text    data     bss     dec     hex filename
  37713   21992      64   59769    e979 .../tegra/tegra210-emc-cc-r21021.o

After:
   text    data     bss     dec     hex filename
  37539   22056      64   59659    e90b .../tegra/tegra210-emc-cc-r21021.o

(gcc version 10.3.0)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/memory/tegra/tegra210-emc-cc-r21021.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/memory/tegra/tegra210-emc-cc-r21021.c b/drivers/memory/tegra/tegra210-emc-cc-r21021.c
index 0ebfa8eccf0c..550d6b2dda30 100644
--- a/drivers/memory/tegra/tegra210-emc-cc-r21021.c
+++ b/drivers/memory/tegra/tegra210-emc-cc-r21021.c
@@ -478,7 +478,7 @@ static u32 periodic_compensation_handler(struct tegra210_emc *emc, u32 type,
 static u32 tegra210_emc_r21021_periodic_compensation(struct tegra210_emc *emc)
 {
 	u32 emc_cfg, emc_cfg_o, emc_cfg_update, del, value;
-	u32 list[] = {
+	static const u32 list[] = {
 		EMC_PMACRO_OB_DDLL_LONG_DQ_RANK0_0,
 		EMC_PMACRO_OB_DDLL_LONG_DQ_RANK0_1,
 		EMC_PMACRO_OB_DDLL_LONG_DQ_RANK0_2,
-- 
2.32.0


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

* Re: [PATCH] memory: tegra: make the array list static const, makes object smaller
  2021-08-19 13:31 [PATCH] memory: tegra: make the array list static const, makes object smaller Colin King
@ 2021-08-19 17:26 ` Thierry Reding
  2021-08-20 10:52 ` Krzysztof Kozlowski
  2021-09-15  7:37 ` Krzysztof Kozlowski
  2 siblings, 0 replies; 4+ messages in thread
From: Thierry Reding @ 2021-08-19 17:26 UTC (permalink / raw)
  To: Colin King
  Cc: Krzysztof Kozlowski, Jonathan Hunter, linux-kernel,
	kernel-janitors, linux-tegra

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

On Thu, Aug 19, 2021 at 02:31:55PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Don't populate the array list on the stack but instead it
> static const. Makes the object code smaller by 110 bytes:
> 
> Before:
>    text    data     bss     dec     hex filename
>   37713   21992      64   59769    e979 .../tegra/tegra210-emc-cc-r21021.o
> 
> After:
>    text    data     bss     dec     hex filename
>   37539   22056      64   59659    e90b .../tegra/tegra210-emc-cc-r21021.o
> 
> (gcc version 10.3.0)
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/memory/tegra/tegra210-emc-cc-r21021.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Wow, didn't think this was going to save us 110 bytes. Nice one!

Acked-by: Thierry Reding <treding@nvidia.com>

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

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

* Re: [PATCH] memory: tegra: make the array list static const, makes object smaller
  2021-08-19 13:31 [PATCH] memory: tegra: make the array list static const, makes object smaller Colin King
  2021-08-19 17:26 ` Thierry Reding
@ 2021-08-20 10:52 ` Krzysztof Kozlowski
  2021-09-15  7:37 ` Krzysztof Kozlowski
  2 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2021-08-20 10:52 UTC (permalink / raw)
  To: Colin King, Thierry Reding, Jonathan Hunter, linux-kernel
  Cc: kernel-janitors, linux-tegra

On 19/08/2021 15:31, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Don't populate the array list on the stack but instead it
> static const. Makes the object code smaller by 110 bytes:
> 
> Before:
>    text    data     bss     dec     hex filename
>   37713   21992      64   59769    e979 .../tegra/tegra210-emc-cc-r21021.o
> 
> After:
>    text    data     bss     dec     hex filename
>   37539   22056      64   59659    e90b .../tegra/tegra210-emc-cc-r21021.o
> 
> (gcc version 10.3.0)
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/memory/tegra/tegra210-emc-cc-r21021.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Looks good, it's too late for this cycle, so I'll take it after merge
window.


Best regards,
Krzysztof

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

* Re: [PATCH] memory: tegra: make the array list static const, makes object smaller
  2021-08-19 13:31 [PATCH] memory: tegra: make the array list static const, makes object smaller Colin King
  2021-08-19 17:26 ` Thierry Reding
  2021-08-20 10:52 ` Krzysztof Kozlowski
@ 2021-09-15  7:37 ` Krzysztof Kozlowski
  2 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2021-09-15  7:37 UTC (permalink / raw)
  To: linux-kernel, Thierry Reding, Colin King, Jonathan Hunter
  Cc: Krzysztof Kozlowski, linux-tegra, kernel-janitors

On Thu, 19 Aug 2021 14:31:55 +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Don't populate the array list on the stack but instead it
> static const. Makes the object code smaller by 110 bytes:
> 
> Before:
>    text    data     bss     dec     hex filename
>   37713   21992      64   59769    e979 .../tegra/tegra210-emc-cc-r21021.o
> 
> [...]

Applied, thanks!

[1/1] memory: tegra: make the array list static const, makes object smaller
      commit: d71b90e3633ff4af8e915ba7adc3c26f7f5edcfe

Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>

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

end of thread, other threads:[~2021-09-15  7:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-19 13:31 [PATCH] memory: tegra: make the array list static const, makes object smaller Colin King
2021-08-19 17:26 ` Thierry Reding
2021-08-20 10:52 ` Krzysztof Kozlowski
2021-09-15  7:37 ` Krzysztof Kozlowski

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