Thread (3 messages) flat view 3 messages, 3 authors, 2021-08-29

Re: [PATCH] rsi: make array fsm_state static const, makes object smaller

From: Joe Perches <joe@perches.com>
Date: 2021-08-21 06:38:35
Also in: kernel-janitors, lkml, netdev

On Thu, 2021-08-19 at 13:50 +0100, Colin King wrote:
From: Colin Ian King <redacted>

Don't populate the array fsm_state on the stack but instead it
static const. Makes the object code smaller by 154 bytes:
[]
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/wireless/rsi/rsi_91x_debugfs.c b/drivers/net/wireless/rsi/rsi_91x_debugfs.c
[]
quoted hunk ↗ jump to hunk
@@ -117,7 +117,7 @@ static int rsi_stats_read(struct seq_file *seq, void *data)
 {
 	struct rsi_common *common = seq->private;
 
-	unsigned char fsm_state[][32] = {
+	static const unsigned char fsm_state[][32] = {
why not the even smaller with a defconfig

	static const char * const fsm_state[] = {
 		"FSM_FW_NOT_LOADED",
 		"FSM_CARD_NOT_READY",
 		"FSM_COMMON_DEV_PARAMS_SENT",
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help