[PATCH] Declare all read only data structures as const

Mikael Kanstrup mikael.kanstrup
Fri Apr 24 00:19:53 PDT 2015


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 at sonymobile.com>
---
 hostapd/hostapd_cli.c             | 12 ++++++------
 src/common/ieee802_11_common.c    | 10 +++++-----
 src/crypto/crypto_module_tests.c  | 37 +++++++++++++++++++------------------
 src/crypto/dh_groups.c            |  2 +-
 src/drivers/driver.h              |  2 +-
 src/drivers/drivers.c             |  2 +-
 src/eap_common/ikev2_common.c     |  6 +++---
 src/eap_peer/eap.c                |  2 +-
 src/eap_peer/eap.h                |  2 +-
 src/eap_peer/eap_i.h              |  2 +-
 src/eap_server/eap.h              |  2 +-
 src/eap_server/eap_i.h            |  2 +-
 src/eap_server/eap_server.c       |  2 +-
 src/eapol_auth/eapol_auth_sm.c    |  4 ++--
 src/eapol_supp/eapol_supp_sm.c    |  2 +-
 src/radius/radius.c               |  6 +++---
 src/radius/radius_server.c        |  4 ++--
 src/wps/ndef.c                    |  6 +++---
 src/wps/wps_module_tests.c        |  4 ++--
 wlantest/gcmp.c                   |  6 +++---
 wlantest/test_vectors.c           |  4 ++--
 wlantest/wlantest.h               |  6 +++---
 wpa_supplicant/ctrl_iface.c       |  2 +-
 wpa_supplicant/p2p_supplicant.c   |  6 +++---
 wpa_supplicant/wpa_cli.c          | 12 ++++++------
 wpa_supplicant/wpa_supplicant.c   | 14 +++++++-------
 wpa_supplicant/wpa_supplicant_i.h | 16 ++++++++--------
 27 files changed, 88 insertions(+), 87 deletions(-)

diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
index 719d021..e299183 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
@@ -19,3 +19,3 @@
 
-static const char *hostapd_cli_version =
+static const char *const hostapd_cli_version =
 "hostapd_cli v" VERSION_STR "\n"
@@ -24,3 +24,3 @@ static const char *hostapd_cli_version =
 
-static const char *hostapd_cli_license =
+static const char *const hostapd_cli_license =
 "This software may be distributed under the terms of the BSD license.\n"
@@ -28,3 +28,3 @@ static const char *hostapd_cli_license =
 
-static const char *hostapd_cli_full_license =
+static const char *const hostapd_cli_full_license =
 "This software may be distributed under the terms of the BSD license.\n"
@@ -59,3 +59,3 @@ static const char *hostapd_cli_full_license =
 
-static const char *commands_help =
+static const char *const commands_help =
 "Commands:\n"
@@ -1017,3 +1017,3 @@ struct hostapd_cli_cmd {
 
-static struct hostapd_cli_cmd hostapd_cli_commands[] = {
+static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
 	{ "ping", hostapd_cli_cmd_ping },
@@ -1072,3 +1072,3 @@ static void wpa_request(struct wpa_ctrl *ctrl, int argc, char *argv[])
 {
-	struct hostapd_cli_cmd *cmd, *match = NULL;
+	const struct hostapd_cli_cmd *cmd, *match = NULL;
 	int count;
diff --git a/src/common/ieee802_11_common.c b/src/common/ieee802_11_common.c
index 7843e6f..e23007a 100644
--- a/src/common/ieee802_11_common.c
+++ b/src/common/ieee802_11_common.c
@@ -566,3 +566,3 @@ enum hostapd_hw_mode ieee80211_freq_to_chan(int freq, u8 *channel)
 
-static const char *us_op_class_cc[] = {
+static const char *const us_op_class_cc[] = {
 	"US", "CA", NULL
@@ -570,3 +570,3 @@ static const char *us_op_class_cc[] = {
 
-static const char *eu_op_class_cc[] = {
+static const char *const eu_op_class_cc[] = {
 	"AL", "AM", "AT", "AZ", "BA", "BE", "BG", "BY", "CH", "CY", "CZ", "DE",
@@ -577,3 +577,3 @@ static const char *eu_op_class_cc[] = {
 
-static const char *jp_op_class_cc[] = {
+static const char *const jp_op_class_cc[] = {
 	"JP", NULL
@@ -581,3 +581,3 @@ static const char *jp_op_class_cc[] = {
 
-static const char *cn_op_class_cc[] = {
+static const char *const cn_op_class_cc[] = {
 	"CN", "CA", NULL
@@ -586,3 +586,3 @@ static const char *cn_op_class_cc[] = {
 
-static int country_match(const char *cc[], const char *country)
+static int country_match(const char *const cc[], const char *const country)
 {
diff --git a/src/crypto/crypto_module_tests.c b/src/crypto/crypto_module_tests.c
index 7137c27..1d613c9 100644
--- a/src/crypto/crypto_module_tests.c
+++ b/src/crypto/crypto_module_tests.c
@@ -163,3 +163,3 @@ struct omac1_test_vector {
 
-static struct omac1_test_vector omac1_test_vectors[] =
+static const struct omac1_test_vector omac1_test_vectors[] =
 {
@@ -212,3 +212,4 @@ static struct omac1_test_vector omac1_test_vectors[] =
 
-static int test_omac1_vector(struct omac1_test_vector *tv, unsigned int i)
+static int test_omac1_vector(const struct omac1_test_vector *tv,
+			     unsigned int i)
 {
@@ -985,3 +986,3 @@ static int test_eap_fast(void)
 
-static u8 key0[] =
+static const u8 key0[] =
 {
@@ -991,4 +992,4 @@ static u8 key0[] =
 };
-static u8 data0[] = "Hi There";
-static u8 prf0[] =
+static const u8 data0[] = "Hi There";
+static const u8 prf0[] =
 {
@@ -1004,5 +1005,5 @@ static u8 prf0[] =
 
-static u8 key1[] = "Jefe";
-static u8 data1[] = "what do ya want for nothing?";
-static u8 prf1[] =
+static const u8 key1[] = "Jefe";
+static const u8 data1[] = "what do ya want for nothing?";
+static const u8 prf1[] =
 {
@@ -1019,3 +1020,3 @@ static u8 prf1[] =
 
-static u8 key2[] =
+static const u8 key2[] =
 {
@@ -1025,3 +1026,3 @@ static u8 key2[] =
 };
-static u8 data2[] =
+static const u8 data2[] =
 {
@@ -1035,3 +1036,3 @@ static u8 data2[] =
 };
-static u8 prf2[] =
+static const u8 prf2[] =
 {
@@ -1054,3 +1055,3 @@ struct passphrase_test {
 
-static struct passphrase_test passphrase_tests[] =
+static const struct passphrase_test passphrase_tests[] =
 {
@@ -1099,3 +1100,3 @@ struct rfc6070_test {
 
-static struct rfc6070_test rfc6070_tests[] =
+static const struct rfc6070_test rfc6070_tests[] =
 {
@@ -1216,3 +1217,3 @@ static int test_sha1(void)
 		u8 psk[32];
-		struct passphrase_test *test = &passphrase_tests[i];
+		const struct passphrase_test *test = &passphrase_tests[i];
 
@@ -1232,3 +1233,3 @@ static int test_sha1(void)
 		u8 dk[25];
-		struct rfc6070_test *test = &rfc6070_tests[i];
+		const struct rfc6070_test *test = &rfc6070_tests[i];
 
@@ -1250,3 +1251,3 @@ static int test_sha1(void)
 
-struct {
+const struct {
 	char *data;
@@ -1274,3 +1275,3 @@ struct {
 
-struct hmac_test {
+const struct hmac_test {
 	u8 key[80];
@@ -1515,3 +1516,3 @@ static int test_sha256(void)
 	for (i = 0; i < ARRAY_SIZE(hmac_tests); i++) {
-		struct hmac_test *t = &hmac_tests[i];
+		const struct hmac_test *t = &hmac_tests[i];
 
diff --git a/src/crypto/dh_groups.c b/src/crypto/dh_groups.c
index d3b2631..3aeb2bb 100644
--- a/src/crypto/dh_groups.c
+++ b/src/crypto/dh_groups.c
@@ -1155,3 +1155,3 @@ dh_group ## id ## _order, sizeof(dh_group ## id ## _order), safe }
 
-static struct dh_group dh_groups[] = {
+static const struct dh_group dh_groups[] = {
 	DH_GROUP(5, 1),
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index e4d0412..f7da636 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -4642,3 +4642,3 @@ wpa_get_wowlan_triggers(const char *wowlan_triggers,
 /* NULL terminated array of linked in driver wrappers */
-extern struct wpa_driver_ops *wpa_drivers[];
+extern const struct wpa_driver_ops *const wpa_drivers[];
 
diff --git a/src/drivers/drivers.c b/src/drivers/drivers.c
index f0c3bb3..a98af9a 100644
--- a/src/drivers/drivers.c
+++ b/src/drivers/drivers.c
@@ -49,3 +49,3 @@ extern struct wpa_driver_ops wpa_driver_none_ops; /* driver_none.c */
 
-struct wpa_driver_ops *wpa_drivers[] =
+const struct wpa_driver_ops *const wpa_drivers[] =
 {
diff --git a/src/eap_common/ikev2_common.c b/src/eap_common/ikev2_common.c
index 4f9e64e..d60358c 100644
--- a/src/eap_common/ikev2_common.c
+++ b/src/eap_common/ikev2_common.c
@@ -18,3 +18,3 @@
 
-static struct ikev2_integ_alg ikev2_integ_algs[] = {
+static const struct ikev2_integ_alg ikev2_integ_algs[] = {
 	{ AUTH_HMAC_SHA1_96, 20, 12 },
@@ -26,3 +26,3 @@ static struct ikev2_integ_alg ikev2_integ_algs[] = {
 
-static struct ikev2_prf_alg ikev2_prf_algs[] = {
+static const struct ikev2_prf_alg ikev2_prf_algs[] = {
 	{ PRF_HMAC_SHA1, 20, 20 },
@@ -34,3 +34,3 @@ static struct ikev2_prf_alg ikev2_prf_algs[] = {
 
-static struct ikev2_encr_alg ikev2_encr_algs[] = {
+static const struct ikev2_encr_alg ikev2_encr_algs[] = {
 	{ ENCR_AES_CBC, 16, 16 }, /* only 128-bit keys supported for now */
diff --git a/src/eap_peer/eap.c b/src/eap_peer/eap.c
index fc4af95..1dbe003 100644
--- a/src/eap_peer/eap.c
+++ b/src/eap_peer/eap.c
@@ -1913,3 +1913,3 @@ static void eap_peer_sm_tls_event(void *ctx, enum tls_event ev,
 struct eap_sm * eap_peer_sm_init(void *eapol_ctx,
-				 struct eapol_callbacks *eapol_cb,
+				 const struct eapol_callbacks *eapol_cb,
 				 void *msg_ctx, struct eap_config *conf)
diff --git a/src/eap_peer/eap.h b/src/eap_peer/eap.h
index 702463b..1a645af 100644
--- a/src/eap_peer/eap.h
+++ b/src/eap_peer/eap.h
@@ -309,3 +309,3 @@ struct eap_config {
 struct eap_sm * eap_peer_sm_init(void *eapol_ctx,
-				 struct eapol_callbacks *eapol_cb,
+				 const struct eapol_callbacks *eapol_cb,
 				 void *msg_ctx, struct eap_config *conf);
diff --git a/src/eap_peer/eap_i.h b/src/eap_peer/eap_i.h
index 2d7fdea..5f8b5fa 100644
--- a/src/eap_peer/eap_i.h
+++ b/src/eap_peer/eap_i.h
@@ -330,3 +330,3 @@ struct eap_sm {
 	void *eapol_ctx;
-	struct eapol_callbacks *eapol_cb;
+	const struct eapol_callbacks *eapol_cb;
 	void *eap_method_priv;
diff --git a/src/eap_server/eap.h b/src/eap_server/eap.h
index b825e18..09be581 100644
--- a/src/eap_server/eap.h
+++ b/src/eap_server/eap.h
@@ -141,3 +141,3 @@ struct eap_config {
 struct eap_sm * eap_server_sm_init(void *eapol_ctx,
-				   struct eapol_callbacks *eapol_cb,
+				   const struct eapol_callbacks *eapol_cb,
 				   struct eap_config *eap_conf);
diff --git a/src/eap_server/eap_i.h b/src/eap_server/eap_i.h
index 7d72309..978c879 100644
--- a/src/eap_server/eap_i.h
+++ b/src/eap_server/eap_i.h
@@ -157,3 +157,3 @@ struct eap_sm {
 	void *eapol_ctx, *msg_ctx;
-	struct eapol_callbacks *eapol_cb;
+	const struct eapol_callbacks *eapol_cb;
 	void *eap_method_priv;
diff --git a/src/eap_server/eap_server.c b/src/eap_server/eap_server.c
index 693debe..1f38d78 100644
--- a/src/eap_server/eap_server.c
+++ b/src/eap_server/eap_server.c
@@ -1804,3 +1804,3 @@ static void eap_user_free(struct eap_user *user)
 struct eap_sm * eap_server_sm_init(void *eapol_ctx,
-				   struct eapol_callbacks *eapol_cb,
+				   const struct eapol_callbacks *eapol_cb,
 				   struct eap_config *conf)
diff --git a/src/eapol_auth/eapol_auth_sm.c b/src/eapol_auth/eapol_auth_sm.c
index 0df6eb5..3b0c2e4 100644
--- a/src/eapol_auth/eapol_auth_sm.c
+++ b/src/eapol_auth/eapol_auth_sm.c
@@ -24,3 +24,3 @@
 
-static struct eapol_callbacks eapol_cb;
+static const struct eapol_callbacks eapol_cb;
 
@@ -1058,3 +1058,3 @@ static int eapol_sm_erp_add_key(void *ctx, struct eap_server_erp_key *erp)
 
-static struct eapol_callbacks eapol_cb =
+static const struct eapol_callbacks eapol_cb =
 {
diff --git a/src/eapol_supp/eapol_supp_sm.c b/src/eapol_supp/eapol_supp_sm.c
index 9cc234a..eb8c5bb 100644
--- a/src/eapol_supp/eapol_supp_sm.c
+++ b/src/eapol_supp/eapol_supp_sm.c
@@ -1999,3 +1999,3 @@ static void eapol_sm_set_anon_id(void *ctx, const u8 *id, size_t len)
 
-static struct eapol_callbacks eapol_cb =
+static const struct eapol_callbacks eapol_cb =
 {
diff --git a/src/radius/radius.c b/src/radius/radius.c
index 2c01b3f..906d8c8 100644
--- a/src/radius/radius.c
+++ b/src/radius/radius.c
@@ -169,3 +169,3 @@ struct radius_attr_type {
 
-static struct radius_attr_type radius_attrs[] =
+static const struct radius_attr_type radius_attrs[] =
 {
@@ -261,3 +261,3 @@ static struct radius_attr_type radius_attrs[] =
 
-static struct radius_attr_type *radius_get_attr_type(u8 type)
+static const struct radius_attr_type *radius_get_attr_type(u8 type)
 {
@@ -276,3 +276,3 @@ static void radius_msg_dump_attr(struct radius_attr_hdr *hdr)
 {
-	struct radius_attr_type *attr;
+	const struct radius_attr_type *attr;
 	int len;
diff --git a/src/radius/radius_server.c b/src/radius/radius_server.c
index 3f881cf..1c69955 100644
--- a/src/radius/radius_server.c
+++ b/src/radius/radius_server.c
@@ -37,3 +37,3 @@
 
-static struct eapol_callbacks radius_server_eapol_cb;
+static const struct eapol_callbacks radius_server_eapol_cb;
 
@@ -2103,3 +2103,3 @@ static int radius_server_erp_add_key(void *ctx, struct eap_server_erp_key *erp)
 
-static struct eapol_callbacks radius_server_eapol_cb =
+static const struct eapol_callbacks radius_server_eapol_cb =
 {
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
@@ -31,4 +31,4 @@ struct ndef_record {
 
-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";
 
@@ -99,3 +99,3 @@ 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,
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
@@ -19,3 +19,3 @@ struct wps_attr_parse_test {
 
-struct wps_attr_parse_test wps_attr_parse_test_cases[] = {
+const struct wps_attr_parse_test wps_attr_parse_test_cases[] = {
 	/* Empty message */
@@ -273,3 +273,3 @@ static int wps_attr_parse_tests(void)
 		size_t len;
-		struct wps_attr_parse_test *test =
+		const struct wps_attr_parse_test *test =
 			&wps_attr_parse_test_cases[i];
diff --git a/wlantest/gcmp.c b/wlantest/gcmp.c
index 161b8a7..d92f4ed 100644
--- a/wlantest/gcmp.c
+++ b/wlantest/gcmp.c
@@ -114,5 +114,5 @@ u8 * gcmp_decrypt(const u8 *tk, size_t tk_len, const struct ieee80211_hdr *hdr,
 
-u8 * gcmp_encrypt(const u8 *tk, size_t tk_len, u8 *frame, size_t len,
-		  size_t hdrlen, u8 *qos,
-		  u8 *pn, int keyid, size_t *encrypted_len)
+u8 * gcmp_encrypt(const u8 *tk, size_t tk_len, const u8 *frame, size_t len,
+		  size_t hdrlen, const u8 *qos,
+		  const u8 *pn, int keyid, size_t *encrypted_len)
 {
diff --git a/wlantest/test_vectors.c b/wlantest/test_vectors.c
index 321d930..36f2f5d 100644
--- a/wlantest/test_vectors.c
+++ b/wlantest/test_vectors.c
@@ -234,3 +234,3 @@ struct gcmp_test {
 
-static struct gcmp_test gcmp_vectors[] =
+static const struct gcmp_test gcmp_vectors[] =
 {
@@ -350,3 +350,3 @@ static struct gcmp_test gcmp_vectors[] =
 
-static int run_gcmp(int idx, struct gcmp_test *vector)
+static int run_gcmp(int idx, const struct gcmp_test *vector)
 {
diff --git a/wlantest/wlantest.h b/wlantest/wlantest.h
index 1d8088f..29bcab5 100644
--- a/wlantest/wlantest.h
+++ b/wlantest/wlantest.h
@@ -293,5 +293,5 @@ u8 * gcmp_decrypt(const u8 *tk, size_t tk_len, const struct ieee80211_hdr *hdr,
 		  const u8 *data, size_t data_len, size_t *decrypted_len);
-u8 * gcmp_encrypt(const u8 *tk, size_t tk_len, u8 *frame, size_t len,
-		  size_t hdrlen, u8 *qos,
-		  u8 *pn, int keyid, size_t *encrypted_len);
+u8 * gcmp_encrypt(const u8 *tk, size_t tk_len, const u8 *frame, size_t len,
+		  size_t hdrlen, const u8 *qos,
+		  const u8 *pn, int keyid, size_t *encrypted_len);
 
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index a6aafee..91617fb 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -8688,3 +8688,3 @@ static int wpa_supplicant_global_iface_list(struct wpa_global *global,
 	for (i = 0; wpa_drivers[i]; i++) {
-		struct wpa_driver_ops *drv = wpa_drivers[i];
+		const struct wpa_driver_ops *drv = wpa_drivers[i];
 		if (drv->get_interfaces == NULL)
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 4c71ef4..b8592d3 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -3101,3 +3101,3 @@ struct p2p_oper_class_map {
 
-static struct p2p_oper_class_map op_class[] = {
+static const struct p2p_oper_class_map op_class[] = {
 	{ HOSTAPD_MODE_IEEE80211G, 81, 1, 13, 1, BW20 },
@@ -3234,3 +3234,3 @@ static int wpas_p2p_setup_channels(struct wpa_supplicant *wpa_s,
 	for (op = 0; op_class[op].op_class; op++) {
-		struct p2p_oper_class_map *o = &op_class[op];
+		const struct p2p_oper_class_map *o = &op_class[op];
 		u8 ch;
@@ -3293,3 +3293,3 @@ int wpas_p2p_get_ht40_mode(struct wpa_supplicant *wpa_s,
 	for (op = 0; op_class[op].op_class; op++) {
-		struct p2p_oper_class_map *o = &op_class[op];
+		const struct p2p_oper_class_map *o = &op_class[op];
 		u8 ch;
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
@@ -28,3 +28,3 @@
 
-static const char *wpa_cli_version =
+static const char *const wpa_cli_version =
 "wpa_cli v" VERSION_STR "\n"
@@ -33,3 +33,3 @@ static const char *wpa_cli_version =
 
-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"
@@ -37,3 +37,3 @@ static const char *wpa_cli_license =
 
-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"
@@ -2807,3 +2807,3 @@ struct wpa_cli_cmd {
 
-static struct wpa_cli_cmd wpa_cli_commands[] = {
+static const struct wpa_cli_cmd wpa_cli_commands[] = {
 	{ "status", wpa_cli_cmd_status, NULL,
@@ -3352,3 +3352,3 @@ static struct wpa_cli_cmd wpa_cli_commands[] = {
  */
-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)
 {
@@ -3490,3 +3490,3 @@ 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;
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 950fdfa..380a506 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -57,3 +57,3 @@
 
-const char *wpa_supplicant_version =
+const char *const wpa_supplicant_version =
 "wpa_supplicant v" VERSION_STR "\n"
@@ -61,3 +61,3 @@ const char *wpa_supplicant_version =
 
-const char *wpa_supplicant_license =
+const char *const wpa_supplicant_license =
 "This software may be distributed under the terms of the BSD license.\n"
@@ -72,5 +72,5 @@ const char *wpa_supplicant_license =
 /* Long text divided into parts in order to fit in C89 strings size limits. */
-const char *wpa_supplicant_full_license1 =
+const char *const wpa_supplicant_full_license1 =
 "";
-const char *wpa_supplicant_full_license2 =
+const char *const wpa_supplicant_full_license2 =
 "This software may be distributed under the terms of the BSD license.\n"
@@ -81,3 +81,3 @@ const char *wpa_supplicant_full_license2 =
 "\n";
-const char *wpa_supplicant_full_license3 =
+const char *const wpa_supplicant_full_license3 =
 "1. Redistributions of source code must retain the above copyright\n"
@@ -89,3 +89,3 @@ const char *wpa_supplicant_full_license3 =
 "\n";
-const char *wpa_supplicant_full_license4 =
+const char *const wpa_supplicant_full_license4 =
 "3. Neither the name(s) of the above-listed copyright holder(s) nor the\n"
@@ -98,3 +98,3 @@ const char *wpa_supplicant_full_license4 =
 "A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n";
-const char *wpa_supplicant_full_license5 =
+const char *const wpa_supplicant_full_license5 =
 "OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n"
diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h
index 1b9753c..9c1a9fd 100644
--- a/wpa_supplicant/wpa_supplicant_i.h
+++ b/wpa_supplicant/wpa_supplicant_i.h
@@ -19,10 +19,10 @@
 
-extern const char *wpa_supplicant_version;
-extern const char *wpa_supplicant_license;
+extern const char *const wpa_supplicant_version;
+extern const char *const wpa_supplicant_license;
 #ifndef CONFIG_NO_STDOUT_DEBUG
-extern const char *wpa_supplicant_full_license1;
-extern const char *wpa_supplicant_full_license2;
-extern const char *wpa_supplicant_full_license3;
-extern const char *wpa_supplicant_full_license4;
-extern const char *wpa_supplicant_full_license5;
+extern const char *const wpa_supplicant_full_license1;
+extern const char *const wpa_supplicant_full_license2;
+extern const char *const wpa_supplicant_full_license3;
+extern const char *const wpa_supplicant_full_license4;
+extern const char *const wpa_supplicant_full_license5;
 #endif /* CONFIG_NO_STDOUT_DEBUG */
@@ -520,3 +520,3 @@ struct wpa_supplicant {
 
-	struct wpa_driver_ops *driver;
+	const struct wpa_driver_ops *driver;
 	int interface_removed; /* whether the network interface has been
-- 
1.8.2.2




More information about the Hostap mailing list