diff mbox series

[4/6] AP: Simplify "i" definition in hostapd_config_free_bss()

Message ID 20190619124916.14150-5-andrei.otcheretianski@intel.com
State Accepted
Headers show
Series AP: Support for 6GHz band | expand

Commit Message

Andrei Otcheretianski June 19, 2019, 12:49 p.m. UTC
Declare the variable only once and reuse it instead of openning
unneeded scopes.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
---
 src/ap/ap_config.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

Comments

Jouni Malinen June 23, 2019, 3:32 p.m. UTC | #1
On Wed, Jun 19, 2019 at 03:49:14PM +0300, Andrei Otcheretianski wrote:
> Declare the variable only once and reuse it instead of openning
> unneeded scopes.

Thanks, patch 4/6 applied.
(and patches 1..3 waiting for updated versions; I've yet to go through
details for 5..6)
diff mbox series

Patch

diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
index 48d09bcf9d..5f0f2e0da7 100644
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
@@ -593,6 +593,8 @@  static void hostapd_dpp_controller_conf_free(struct dpp_controller_conf *conf)
 
 void hostapd_config_free_bss(struct hostapd_bss_config *conf)
 {
+	size_t i;
+
 	if (conf == NULL)
 		return;
 
@@ -685,12 +687,8 @@  void hostapd_config_free_bss(struct hostapd_bss_config *conf)
 	os_free(conf->model_description);
 	os_free(conf->model_url);
 	os_free(conf->upc);
-	{
-		unsigned int i;
-
-		for (i = 0; i < MAX_WPS_VENDOR_EXTENSIONS; i++)
-			wpabuf_free(conf->wps_vendor_ext[i]);
-	}
+	for (i = 0; i < MAX_WPS_VENDOR_EXTENSIONS; i++)
+		wpabuf_free(conf->wps_vendor_ext[i]);
 	wpabuf_free(conf->wps_nfc_dh_pubkey);
 	wpabuf_free(conf->wps_nfc_dh_privkey);
 	wpabuf_free(conf->wps_nfc_dev_pw);
@@ -716,7 +714,6 @@  void hostapd_config_free_bss(struct hostapd_bss_config *conf)
 	os_free(conf->hs20_operating_class);
 	os_free(conf->hs20_icons);
 	if (conf->hs20_osu_providers) {
-		size_t i;
 		for (i = 0; i < conf->hs20_osu_providers_count; i++) {
 			struct hs20_osu_provider *p;
 			size_t j;
@@ -734,8 +731,6 @@  void hostapd_config_free_bss(struct hostapd_bss_config *conf)
 		os_free(conf->hs20_osu_providers);
 	}
 	if (conf->hs20_operator_icon) {
-		size_t i;
-
 		for (i = 0; i < conf->hs20_operator_icon_count; i++)
 			os_free(conf->hs20_operator_icon[i]);
 		os_free(conf->hs20_operator_icon);