All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pinctrl: single: make two arrays static const, reduces object code size
@ 2017-09-19 14:42 ` Colin King
  0 siblings, 0 replies; 10+ messages in thread
From: Colin King @ 2017-09-19 14:42 UTC (permalink / raw)
  To: Tony Lindgren, Haojian Zhuang, Linus Walleij, linux-arm-kernel,
	linux-omap, linux-gpio
  Cc: kernel-janitors, linux-kernel

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

Don't populate the read-only arrays prop2 and prop4 on the stack, instead
make them static const.  Makes the object code smaller by over 230 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
  28235	   5820	    192	  34247	   85c7	drivers/pinctrl/pinctrl-single.o

After:
   text	   data	    bss	    dec	    hex	filename
  27839	   5980	    192	  34011	   84db	drivers/pinctrl/pinctrl-single.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/pinctrl/pinctrl-single.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index b8b3d932cd73..e6cd8de793e2 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -873,13 +873,13 @@ static int pcs_parse_pinconf(struct pcs_device *pcs, struct device_node *np,
 	int i = 0, nconfs = 0;
 	unsigned long *settings = NULL, *s = NULL;
 	struct pcs_conf_vals *conf = NULL;
-	struct pcs_conf_type prop2[] = {
+	static const struct pcs_conf_type prop2[] = {
 		{ "pinctrl-single,drive-strength", PIN_CONFIG_DRIVE_STRENGTH, },
 		{ "pinctrl-single,slew-rate", PIN_CONFIG_SLEW_RATE, },
 		{ "pinctrl-single,input-schmitt", PIN_CONFIG_INPUT_SCHMITT, },
 		{ "pinctrl-single,low-power-mode", PIN_CONFIG_LOW_POWER_MODE, },
 	};
-	struct pcs_conf_type prop4[] = {
+	static const struct pcs_conf_type prop4[] = {
 		{ "pinctrl-single,bias-pullup", PIN_CONFIG_BIAS_PULL_UP, },
 		{ "pinctrl-single,bias-pulldown", PIN_CONFIG_BIAS_PULL_DOWN, },
 		{ "pinctrl-single,input-schmitt-enable",
-- 
2.14.1


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

* [PATCH] pinctrl: single: make two arrays static const, reduces object code size
@ 2017-09-19 14:42 ` Colin King
  0 siblings, 0 replies; 10+ messages in thread
From: Colin King @ 2017-09-19 14:42 UTC (permalink / raw)
  To: linux-arm-kernel

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

Don't populate the read-only arrays prop2 and prop4 on the stack, instead
make them static const.  Makes the object code smaller by over 230 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
  28235	   5820	    192	  34247	   85c7	drivers/pinctrl/pinctrl-single.o

After:
   text	   data	    bss	    dec	    hex	filename
  27839	   5980	    192	  34011	   84db	drivers/pinctrl/pinctrl-single.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/pinctrl/pinctrl-single.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index b8b3d932cd73..e6cd8de793e2 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -873,13 +873,13 @@ static int pcs_parse_pinconf(struct pcs_device *pcs, struct device_node *np,
 	int i = 0, nconfs = 0;
 	unsigned long *settings = NULL, *s = NULL;
 	struct pcs_conf_vals *conf = NULL;
-	struct pcs_conf_type prop2[] = {
+	static const struct pcs_conf_type prop2[] = {
 		{ "pinctrl-single,drive-strength", PIN_CONFIG_DRIVE_STRENGTH, },
 		{ "pinctrl-single,slew-rate", PIN_CONFIG_SLEW_RATE, },
 		{ "pinctrl-single,input-schmitt", PIN_CONFIG_INPUT_SCHMITT, },
 		{ "pinctrl-single,low-power-mode", PIN_CONFIG_LOW_POWER_MODE, },
 	};
-	struct pcs_conf_type prop4[] = {
+	static const struct pcs_conf_type prop4[] = {
 		{ "pinctrl-single,bias-pullup", PIN_CONFIG_BIAS_PULL_UP, },
 		{ "pinctrl-single,bias-pulldown", PIN_CONFIG_BIAS_PULL_DOWN, },
 		{ "pinctrl-single,input-schmitt-enable",
-- 
2.14.1


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

* [PATCH] pinctrl: single: make two arrays static const, reduces object code size
@ 2017-09-19 14:42 ` Colin King
  0 siblings, 0 replies; 10+ messages in thread
From: Colin King @ 2017-09-19 14:42 UTC (permalink / raw)
  To: linux-arm-kernel

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

Don't populate the read-only arrays prop2 and prop4 on the stack, instead
make them static const.  Makes the object code smaller by over 230 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
  28235	   5820	    192	  34247	   85c7	drivers/pinctrl/pinctrl-single.o

After:
   text	   data	    bss	    dec	    hex	filename
  27839	   5980	    192	  34011	   84db	drivers/pinctrl/pinctrl-single.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/pinctrl/pinctrl-single.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index b8b3d932cd73..e6cd8de793e2 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -873,13 +873,13 @@ static int pcs_parse_pinconf(struct pcs_device *pcs, struct device_node *np,
 	int i = 0, nconfs = 0;
 	unsigned long *settings = NULL, *s = NULL;
 	struct pcs_conf_vals *conf = NULL;
-	struct pcs_conf_type prop2[] = {
+	static const struct pcs_conf_type prop2[] = {
 		{ "pinctrl-single,drive-strength", PIN_CONFIG_DRIVE_STRENGTH, },
 		{ "pinctrl-single,slew-rate", PIN_CONFIG_SLEW_RATE, },
 		{ "pinctrl-single,input-schmitt", PIN_CONFIG_INPUT_SCHMITT, },
 		{ "pinctrl-single,low-power-mode", PIN_CONFIG_LOW_POWER_MODE, },
 	};
-	struct pcs_conf_type prop4[] = {
+	static const struct pcs_conf_type prop4[] = {
 		{ "pinctrl-single,bias-pullup", PIN_CONFIG_BIAS_PULL_UP, },
 		{ "pinctrl-single,bias-pulldown", PIN_CONFIG_BIAS_PULL_DOWN, },
 		{ "pinctrl-single,input-schmitt-enable",
-- 
2.14.1

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

* Re: [PATCH] pinctrl: single: make two arrays static const, reduces object code size
  2017-09-19 14:42 ` Colin King
  (?)
@ 2017-09-19 16:26   ` Tony Lindgren
  -1 siblings, 0 replies; 10+ messages in thread
From: Tony Lindgren @ 2017-09-19 16:26 UTC (permalink / raw)
  To: Colin King
  Cc: Haojian Zhuang, Linus Walleij, linux-arm-kernel, linux-omap,
	linux-gpio, kernel-janitors, linux-kernel

* Colin King <colin.king@canonical.com> [170919 07:43]:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Don't populate the read-only arrays prop2 and prop4 on the stack, instead
> make them static const.  Makes the object code smaller by over 230 bytes:
> 
> Before:
>    text	   data	    bss	    dec	    hex	filename
>   28235	   5820	    192	  34247	   85c7	drivers/pinctrl/pinctrl-single.o
> 
> After:
>    text	   data	    bss	    dec	    hex	filename
>   27839	   5980	    192	  34011	   84db	drivers/pinctrl/pinctrl-single.o
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Acked-by: Tony Lindgren <tony@atomide.com>

> ---
>  drivers/pinctrl/pinctrl-single.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
> index b8b3d932cd73..e6cd8de793e2 100644
> --- a/drivers/pinctrl/pinctrl-single.c
> +++ b/drivers/pinctrl/pinctrl-single.c
> @@ -873,13 +873,13 @@ static int pcs_parse_pinconf(struct pcs_device *pcs, struct device_node *np,
>  	int i = 0, nconfs = 0;
>  	unsigned long *settings = NULL, *s = NULL;
>  	struct pcs_conf_vals *conf = NULL;
> -	struct pcs_conf_type prop2[] = {
> +	static const struct pcs_conf_type prop2[] = {
>  		{ "pinctrl-single,drive-strength", PIN_CONFIG_DRIVE_STRENGTH, },
>  		{ "pinctrl-single,slew-rate", PIN_CONFIG_SLEW_RATE, },
>  		{ "pinctrl-single,input-schmitt", PIN_CONFIG_INPUT_SCHMITT, },
>  		{ "pinctrl-single,low-power-mode", PIN_CONFIG_LOW_POWER_MODE, },
>  	};
> -	struct pcs_conf_type prop4[] = {
> +	static const struct pcs_conf_type prop4[] = {
>  		{ "pinctrl-single,bias-pullup", PIN_CONFIG_BIAS_PULL_UP, },
>  		{ "pinctrl-single,bias-pulldown", PIN_CONFIG_BIAS_PULL_DOWN, },
>  		{ "pinctrl-single,input-schmitt-enable",
> -- 
> 2.14.1
> 

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

* Re: [PATCH] pinctrl: single: make two arrays static const, reduces object code size
@ 2017-09-19 16:26   ` Tony Lindgren
  0 siblings, 0 replies; 10+ messages in thread
From: Tony Lindgren @ 2017-09-19 16:26 UTC (permalink / raw)
  To: linux-arm-kernel

* Colin King <colin.king@canonical.com> [170919 07:43]:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Don't populate the read-only arrays prop2 and prop4 on the stack, instead
> make them static const.  Makes the object code smaller by over 230 bytes:
> 
> Before:
>    text	   data	    bss	    dec	    hex	filename
>   28235	   5820	    192	  34247	   85c7	drivers/pinctrl/pinctrl-single.o
> 
> After:
>    text	   data	    bss	    dec	    hex	filename
>   27839	   5980	    192	  34011	   84db	drivers/pinctrl/pinctrl-single.o
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Acked-by: Tony Lindgren <tony@atomide.com>

> ---
>  drivers/pinctrl/pinctrl-single.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
> index b8b3d932cd73..e6cd8de793e2 100644
> --- a/drivers/pinctrl/pinctrl-single.c
> +++ b/drivers/pinctrl/pinctrl-single.c
> @@ -873,13 +873,13 @@ static int pcs_parse_pinconf(struct pcs_device *pcs, struct device_node *np,
>  	int i = 0, nconfs = 0;
>  	unsigned long *settings = NULL, *s = NULL;
>  	struct pcs_conf_vals *conf = NULL;
> -	struct pcs_conf_type prop2[] = {
> +	static const struct pcs_conf_type prop2[] = {
>  		{ "pinctrl-single,drive-strength", PIN_CONFIG_DRIVE_STRENGTH, },
>  		{ "pinctrl-single,slew-rate", PIN_CONFIG_SLEW_RATE, },
>  		{ "pinctrl-single,input-schmitt", PIN_CONFIG_INPUT_SCHMITT, },
>  		{ "pinctrl-single,low-power-mode", PIN_CONFIG_LOW_POWER_MODE, },
>  	};
> -	struct pcs_conf_type prop4[] = {
> +	static const struct pcs_conf_type prop4[] = {
>  		{ "pinctrl-single,bias-pullup", PIN_CONFIG_BIAS_PULL_UP, },
>  		{ "pinctrl-single,bias-pulldown", PIN_CONFIG_BIAS_PULL_DOWN, },
>  		{ "pinctrl-single,input-schmitt-enable",
> -- 
> 2.14.1
> 

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

* [PATCH] pinctrl: single: make two arrays static const, reduces object code size
@ 2017-09-19 16:26   ` Tony Lindgren
  0 siblings, 0 replies; 10+ messages in thread
From: Tony Lindgren @ 2017-09-19 16:26 UTC (permalink / raw)
  To: linux-arm-kernel

* Colin King <colin.king@canonical.com> [170919 07:43]:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Don't populate the read-only arrays prop2 and prop4 on the stack, instead
> make them static const.  Makes the object code smaller by over 230 bytes:
> 
> Before:
>    text	   data	    bss	    dec	    hex	filename
>   28235	   5820	    192	  34247	   85c7	drivers/pinctrl/pinctrl-single.o
> 
> After:
>    text	   data	    bss	    dec	    hex	filename
>   27839	   5980	    192	  34011	   84db	drivers/pinctrl/pinctrl-single.o
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Acked-by: Tony Lindgren <tony@atomide.com>

> ---
>  drivers/pinctrl/pinctrl-single.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
> index b8b3d932cd73..e6cd8de793e2 100644
> --- a/drivers/pinctrl/pinctrl-single.c
> +++ b/drivers/pinctrl/pinctrl-single.c
> @@ -873,13 +873,13 @@ static int pcs_parse_pinconf(struct pcs_device *pcs, struct device_node *np,
>  	int i = 0, nconfs = 0;
>  	unsigned long *settings = NULL, *s = NULL;
>  	struct pcs_conf_vals *conf = NULL;
> -	struct pcs_conf_type prop2[] = {
> +	static const struct pcs_conf_type prop2[] = {
>  		{ "pinctrl-single,drive-strength", PIN_CONFIG_DRIVE_STRENGTH, },
>  		{ "pinctrl-single,slew-rate", PIN_CONFIG_SLEW_RATE, },
>  		{ "pinctrl-single,input-schmitt", PIN_CONFIG_INPUT_SCHMITT, },
>  		{ "pinctrl-single,low-power-mode", PIN_CONFIG_LOW_POWER_MODE, },
>  	};
> -	struct pcs_conf_type prop4[] = {
> +	static const struct pcs_conf_type prop4[] = {
>  		{ "pinctrl-single,bias-pullup", PIN_CONFIG_BIAS_PULL_UP, },
>  		{ "pinctrl-single,bias-pulldown", PIN_CONFIG_BIAS_PULL_DOWN, },
>  		{ "pinctrl-single,input-schmitt-enable",
> -- 
> 2.14.1
> 

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

* Re: [PATCH] pinctrl: single: make two arrays static const, reduces object code size
  2017-09-19 14:42 ` Colin King
  (?)
  (?)
@ 2017-09-21 12:10   ` Linus Walleij
  -1 siblings, 0 replies; 10+ messages in thread
From: Linus Walleij @ 2017-09-21 12:10 UTC (permalink / raw)
  To: Colin King
  Cc: Tony Lindgren, Haojian Zhuang, linux-arm-kernel, Linux-OMAP,
	linux-gpio, kernel-janitors, linux-kernel

On Tue, Sep 19, 2017 at 4:42 PM, Colin King <colin.king@canonical.com> wrote:

> From: Colin Ian King <colin.king@canonical.com>
>
> Don't populate the read-only arrays prop2 and prop4 on the stack, instead
> make them static const.  Makes the object code smaller by over 230 bytes:
>
> Before:
>    text    data     bss     dec     hex filename
>   28235    5820     192   34247    85c7 drivers/pinctrl/pinctrl-single.o
>
> After:
>    text    data     bss     dec     hex filename
>   27839    5980     192   34011    84db drivers/pinctrl/pinctrl-single.o
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Patch applied with Tony's ACK.

Yours,
Linus Walleij

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

* Re: [PATCH] pinctrl: single: make two arrays static const, reduces object code size
@ 2017-09-21 12:10   ` Linus Walleij
  0 siblings, 0 replies; 10+ messages in thread
From: Linus Walleij @ 2017-09-21 12:10 UTC (permalink / raw)
  To: Colin King
  Cc: Tony Lindgren, Haojian Zhuang, linux-arm-kernel, Linux-OMAP,
	linux-gpio, kernel-janitors, linux-kernel

On Tue, Sep 19, 2017 at 4:42 PM, Colin King <colin.king@canonical.com> wrote:

> From: Colin Ian King <colin.king@canonical.com>
>
> Don't populate the read-only arrays prop2 and prop4 on the stack, instead
> make them static const.  Makes the object code smaller by over 230 bytes:
>
> Before:
>    text    data     bss     dec     hex filename
>   28235    5820     192   34247    85c7 drivers/pinctrl/pinctrl-single.o
>
> After:
>    text    data     bss     dec     hex filename
>   27839    5980     192   34011    84db drivers/pinctrl/pinctrl-single.o
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Patch applied with Tony's ACK.

Yours,
Linus Walleij

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

* Re: [PATCH] pinctrl: single: make two arrays static const, reduces object code size
@ 2017-09-21 12:10   ` Linus Walleij
  0 siblings, 0 replies; 10+ messages in thread
From: Linus Walleij @ 2017-09-21 12:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Sep 19, 2017 at 4:42 PM, Colin King <colin.king@canonical.com> wrote:

> From: Colin Ian King <colin.king@canonical.com>
>
> Don't populate the read-only arrays prop2 and prop4 on the stack, instead
> make them static const.  Makes the object code smaller by over 230 bytes:
>
> Before:
>    text    data     bss     dec     hex filename
>   28235    5820     192   34247    85c7 drivers/pinctrl/pinctrl-single.o
>
> After:
>    text    data     bss     dec     hex filename
>   27839    5980     192   34011    84db drivers/pinctrl/pinctrl-single.o
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Patch applied with Tony's ACK.

Yours,
Linus Walleij

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

* [PATCH] pinctrl: single: make two arrays static const, reduces object code size
@ 2017-09-21 12:10   ` Linus Walleij
  0 siblings, 0 replies; 10+ messages in thread
From: Linus Walleij @ 2017-09-21 12:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Sep 19, 2017 at 4:42 PM, Colin King <colin.king@canonical.com> wrote:

> From: Colin Ian King <colin.king@canonical.com>
>
> Don't populate the read-only arrays prop2 and prop4 on the stack, instead
> make them static const.  Makes the object code smaller by over 230 bytes:
>
> Before:
>    text    data     bss     dec     hex filename
>   28235    5820     192   34247    85c7 drivers/pinctrl/pinctrl-single.o
>
> After:
>    text    data     bss     dec     hex filename
>   27839    5980     192   34011    84db drivers/pinctrl/pinctrl-single.o
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Patch applied with Tony's ACK.

Yours,
Linus Walleij

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

end of thread, other threads:[~2017-09-21 12:10 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-19 14:42 [PATCH] pinctrl: single: make two arrays static const, reduces object code size Colin King
2017-09-19 14:42 ` Colin King
2017-09-19 14:42 ` Colin King
2017-09-19 16:26 ` Tony Lindgren
2017-09-19 16:26   ` Tony Lindgren
2017-09-19 16:26   ` Tony Lindgren
2017-09-21 12:10 ` Linus Walleij
2017-09-21 12:10   ` Linus Walleij
2017-09-21 12:10   ` Linus Walleij
2017-09-21 12:10   ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.