drivers: modem: gsm_ppp: constify modem_cmd and setup_cmd structures

Constifying global data allows to save lots of RAM. This improvement
allows to save 224 bytes of RAM when compiled on ARM, with default
configuration.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
This commit is contained in:
Marcin Niestroj 2020-11-19 22:39:18 +01:00 committed by Jukka Rissanen
commit c934e74bf9

View file

@ -102,7 +102,7 @@ MODEM_CMD_DEFINE(gsm_cmd_error)
return 0;
}
static struct modem_cmd response_cmds[] = {
static const struct modem_cmd response_cmds[] = {
MODEM_CMD("OK", gsm_cmd_ok, 0U, ""),
MODEM_CMD("ERROR", gsm_cmd_error, 0U, ""),
MODEM_CMD("CONNECT", gsm_cmd_ok, 0U, ""),
@ -230,7 +230,7 @@ MODEM_CMD_DEFINE(on_cmd_atcmdinfo_iccid)
#endif /* CONFIG_MODEM_SIM_NUMBERS */
#endif /* CONFIG_MODEM_SHELL */
static struct setup_cmd setup_cmds[] = {
static const struct setup_cmd setup_cmds[] = {
/* no echo */
SETUP_CMD_NOHANDLE("ATE0"),
/* hang up */
@ -273,10 +273,10 @@ MODEM_CMD_DEFINE(on_cmd_atcmdinfo_attached)
return 0;
}
static struct modem_cmd check_attached_cmd =
static const struct modem_cmd check_attached_cmd =
MODEM_CMD("+CGATT:", on_cmd_atcmdinfo_attached, 1U, ",");
static struct setup_cmd connect_cmds[] = {
static const struct setup_cmd connect_cmds[] = {
/* connect to network */
SETUP_CMD_NOHANDLE("ATD*99#"),
};