kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: accel: make array init_data static to reduce code size
@ 2017-07-07 15:55 Colin King
  2017-07-09 18:12 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2017-07-07 15:55 UTC (permalink / raw)
  To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Hans de Goede, Rob Herring, linux-iio
  Cc: kernel-janitors, linux-kernel

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

Making the const array init_data static rather having it on the
stack saves us a couple hundreds of bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
   3175	    848	      0	   4023	    fb7	drivers/iio/accel/da311.o

After:
   text	   data	    bss	    dec	    hex	filename
   2860	    936	      0	   3796	    ed4	drivers/iio/accel/da311.o

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

diff --git a/drivers/iio/accel/da311.c b/drivers/iio/accel/da311.c
index 537cfa8b6edf..c0c1620d2a2f 100644
--- a/drivers/iio/accel/da311.c
+++ b/drivers/iio/accel/da311.c
@@ -139,7 +139,7 @@ static int da311_register_mask_write(struct i2c_client *client, u16 addr,
 /* Init sequence taken from the android driver */
 static int da311_reset(struct i2c_client *client)
 {
-	const struct {
+	static const struct {
 		u16 addr;
 		u8 mask;
 		u8 data;
-- 
2.11.0


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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-07 15:55 [PATCH] iio: accel: make array init_data static to reduce code size Colin King
2017-07-09 18:12 ` Jonathan Cameron

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