aboutsummaryrefslogtreecommitdiffstats
path: root/src/wps
diff options
context:
space:
mode:
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 /src/wps
parentfd4fb28179a0b750dff4d38a72a7bf89a2c49813 (diff)
downloadhostap-8b423edbd3bb7b5b90cf3d82103d44bedab63e5c.zip
hostap-8b423edbd3bb7b5b90cf3d82103d44bedab63e5c.tar.gz
hostap-8b423edbd3bb7b5b90cf3d82103d44bedab63e5c.tar.bz2
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 'src/wps')
-rw-r--r--src/wps/ndef.c6
-rw-r--r--src/wps/wps_module_tests.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/wps/ndef.c b/src/wps/ndef.c
index d45dfc8..8d1ce1e 100644
--- a/src/wps/ndef.c
+++ b/src/wps/ndef.c
@@ -29,8 +29,8 @@ struct ndef_record {
u32 total_length;
};
-static char wifi_handover_type[] = "application/vnd.wfa.wsc";
-static char p2p_handover_type[] = "application/vnd.wfa.p2p";
+static const char wifi_handover_type[] = "application/vnd.wfa.wsc";
+static const char p2p_handover_type[] = "application/vnd.wfa.p2p";
static int ndef_parse_record(const u8 *data, u32 size,
struct ndef_record *record)
@@ -97,7 +97,7 @@ static struct wpabuf * ndef_parse_records(const struct wpabuf *buf,
}
-static struct wpabuf * ndef_build_record(u8 flags, void *type,
+static struct wpabuf * ndef_build_record(u8 flags, const void *type,
u8 type_length, void *id,
u8 id_length,
const struct wpabuf *payload)
diff --git a/src/wps/wps_module_tests.c b/src/wps/wps_module_tests.c
index 6800e86..3506307 100644
--- a/src/wps/wps_module_tests.c
+++ b/src/wps/wps_module_tests.c
@@ -17,7 +17,7 @@ struct wps_attr_parse_test {
int extra;
};
-struct wps_attr_parse_test wps_attr_parse_test_cases[] = {
+const struct wps_attr_parse_test wps_attr_parse_test_cases[] = {
/* Empty message */
{ "", 0, 0 },
/* Truncated attribute header */
@@ -271,7 +271,7 @@ static int wps_attr_parse_tests(void)
for (i = 0; i < ARRAY_SIZE(wps_attr_parse_test_cases); i++) {
struct wpabuf *buf;
size_t len;
- struct wps_attr_parse_test *test =
+ const struct wps_attr_parse_test *test =
&wps_attr_parse_test_cases[i];
len = os_strlen(test->data) / 2;