path: root/wpa_supplicant/wpa_cli.c
diff options
authorMikael Kanstrup <mikael.kanstrup@sonymobile.com>2015-04-24 07:19:53 (GMT)
committerJouni Malinen <j@w1.fi>2015-04-25 14:33:06 (GMT)
commit8b423edbd3bb7b5b90cf3d82103d44bedab63e5c (patch)
tree12eb22ee298692ca04144fa97818aa1f8e93c0ab /wpa_supplicant/wpa_cli.c
parentfd4fb28179a0b750dff4d38a72a7bf89a2c49813 (diff)
Declare all read only data structures as const
By analysing objdump output some read only structures were found in .data section. To help compiler further optimize code declare these as const. Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
Diffstat (limited to 'wpa_supplicant/wpa_cli.c')
1 files changed, 6 insertions, 6 deletions
diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
index 9fbc532..bf0a03f 100644
--- a/wpa_supplicant/wpa_cli.c
+++ b/wpa_supplicant/wpa_cli.c
@@ -26,16 +26,16 @@
#endif /* ANDROID */
-static const char *wpa_cli_version =
+static const char *const wpa_cli_version =
"wpa_cli v" VERSION_STR "\n"
"Copyright (c) 2004-2015, Jouni Malinen <j@w1.fi> and contributors";
-static const char *wpa_cli_license =
+static const char *const wpa_cli_license =
"This software may be distributed under the terms of the BSD license.\n"
"See README for more details.\n";
-static const char *wpa_cli_full_license =
+static const char *const wpa_cli_full_license =
"This software may be distributed under the terms of the BSD license.\n"
"Redistribution and use in source and binary forms, with or without\n"
@@ -2805,7 +2805,7 @@ struct wpa_cli_cmd {
const char *usage;
-static struct wpa_cli_cmd wpa_cli_commands[] = {
+static const struct wpa_cli_cmd wpa_cli_commands[] = {
{ "status", wpa_cli_cmd_status, NULL,
"[verbose] = get current WPA/EAPOL/EAP status" },
@@ -3350,7 +3350,7 @@ static struct wpa_cli_cmd wpa_cli_commands[] = {
* Prints command usage, lines are padded with the specified string.
-static void print_cmd_help(struct wpa_cli_cmd *cmd, const char *pad)
+static void print_cmd_help(const struct wpa_cli_cmd *cmd, const char *pad)
char c;
size_t n;
@@ -3488,7 +3488,7 @@ static char ** wpa_cli_edit_completion_cb(void *ctx, const char *str, int pos)
static int wpa_request(struct wpa_ctrl *ctrl, int argc, char *argv[])
- struct wpa_cli_cmd *cmd, *match = NULL;
+ const struct wpa_cli_cmd *cmd, *match = NULL;
int count;
int ret = 0;