rtw89: rtw89_ser: add const to struct state_ent and event_ent
authorJoe Perches <joe@perches.com>
Thu, 7 Apr 2022 20:14:44 +0000 (13:14 -0700)
committerKalle Valo <kvalo@kernel.org>
Tue, 12 Apr 2022 13:37:49 +0000 (16:37 +0300)
Change the struct and the uses to const to reduce data.

$ size drivers/net/wireless/realtek/rtw89/ser.o* (x86-64 defconfig w/ rtw89)
   text    data     bss     dec     hex filename
   3741       8       0    3749     ea5 drivers/net/wireless/realtek/rtw89/ser.o.new
   3437     312       0    3749     ea5 drivers/net/wireless/realtek/rtw89/ser.o.old

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/2fd88e6119f62b968477ef9781abb1832d399fd6.camel@perches.com
drivers/net/wireless/realtek/rtw89/core.h
drivers/net/wireless/realtek/rtw89/ser.c

index a6c075a..ec181c1 100644 (file)
@@ -2948,8 +2948,8 @@ struct rtw89_ser {
 
        struct work_struct ser_hdl_work;
        struct delayed_work ser_alarm_work;
-       struct state_ent *st_tbl;
-       struct event_ent *ev_tbl;
+       const struct state_ent *st_tbl;
+       const struct event_ent *ev_tbl;
        struct list_head msg_q;
        spinlock_t msg_q_lock; /* lock when read/write ser msg */
        DECLARE_BITMAP(flags, RTW89_NUM_OF_SER_FLAGS);
index 5aebd68..9e95ed9 100644 (file)
@@ -632,7 +632,7 @@ static void ser_l2_reset_st_hdl(struct rtw89_ser *ser, u8 evt)
        }
 }
 
-static struct event_ent ser_ev_tbl[] = {
+static const struct event_ent ser_ev_tbl[] = {
        {SER_EV_NONE, "SER_EV_NONE"},
        {SER_EV_STATE_IN, "SER_EV_STATE_IN"},
        {SER_EV_STATE_OUT, "SER_EV_STATE_OUT"},
@@ -648,7 +648,7 @@ static struct event_ent ser_ev_tbl[] = {
        {SER_EV_MAXX, "SER_EV_MAX"}
 };
 
-static struct state_ent ser_st_tbl[] = {
+static const struct state_ent ser_st_tbl[] = {
        {SER_IDLE_ST, "SER_IDLE_ST", ser_idle_st_hdl},
        {SER_RESET_TRX_ST, "SER_RESET_TRX_ST", ser_reset_trx_st_hdl},
        {SER_DO_HCI_ST, "SER_DO_HCI_ST", ser_do_hci_st_hdl},