linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: mb86a20s: make arrays static const
@ 2021-09-15 11:56 Colin King
  0 siblings, 0 replies; only message in thread
From: Colin King @ 2021-09-15 11:56 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, linux-media; +Cc: kernel-janitors, linux-kernel

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

Don't populate the read-only arrays on the stack but instead them
static const. Also makes the object code smaller by 154 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
  42949	  22424	      0	  65373	   ff5d	media/dvb-frontends/mb86a20s.o

After:
   text	   data	    bss	    dec	    hex	filename
  42731	  22488	      0	  65219	   fec3	media/dvb-frontends/mb86a20s.o

(gcc version 11.2.0)

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

diff --git a/drivers/media/dvb-frontends/mb86a20s.c b/drivers/media/dvb-frontends/mb86a20s.c
index a7faf0cf8788..b74b9afed9a2 100644
--- a/drivers/media/dvb-frontends/mb86a20s.c
+++ b/drivers/media/dvb-frontends/mb86a20s.c
@@ -444,11 +444,11 @@ static int mb86a20s_get_interleaving(struct mb86a20s_state *state,
 				     unsigned layer)
 {
 	int rc;
-	int interleaving[] = {
+	static const int interleaving[] = {
 		0, 1, 2, 4, 8
 	};
 
-	static unsigned char reg[] = {
+	static const unsigned char reg[] = {
 		[0] = 0x88,	/* Layer A */
 		[1] = 0x8c,	/* Layer B */
 		[2] = 0x90,	/* Layer C */
-- 
2.32.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-15 11:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-15 11:56 [PATCH] media: mb86a20s: make arrays static const Colin King

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