[PATCH] cleanup: remove unreachable code

Baligh Gasmi gasmibal at gmail.com
Mon Feb 7 05:46:24 PST 2022


no necessary for unreachable code, so remove it.

Signed-off-by: Baligh Gasmi <gasmibal at gmail.com>
---
 hostapd/main.c                 | 1 -
 hs20/client/osu_client.c       | 1 -
 hs20/client/spp_client.c       | 1 -
 src/ap/wpa_auth_kay.c          | 1 -
 src/common/ctrl_iface_common.c | 2 --
 wpa_supplicant/wpas_kay.c      | 1 -
 6 files changed, 7 deletions(-)

diff --git a/hostapd/main.c b/hostapd/main.c
index c9ec38d19..7c347f905 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -723,7 +723,6 @@ int main(int argc, char *argv[])
 		case 'v':
 			show_version();
 			exit(1);
-			break;
 		case 'g':
 			if (hostapd_get_global_ctrl_iface(&interfaces, optarg))
 				return -1;
diff --git a/hs20/client/osu_client.c b/hs20/client/osu_client.c
index 11bf0db35..77b15403c 100644
--- a/hs20/client/osu_client.c
+++ b/hs20/client/osu_client.c
@@ -3249,7 +3249,6 @@ int main(int argc, char *argv[])
 		default:
 			usage();
 			exit(0);
-			break;
 		}
 	}
 
diff --git a/hs20/client/spp_client.c b/hs20/client/spp_client.c
index 39d10e036..194518e5a 100644
--- a/hs20/client/spp_client.c
+++ b/hs20/client/spp_client.c
@@ -564,7 +564,6 @@ static int hs20_spp_exec(struct hs20_osu_client *ctx, xml_node_t *exec,
 			free(id);
 			return -1;
 		}
-		return 0;
 	}
 
 	if (strcasecmp(name, "uploadMO") == 0) {
diff --git a/src/ap/wpa_auth_kay.c b/src/ap/wpa_auth_kay.c
index 46d94b43f..827118715 100644
--- a/src/ap/wpa_auth_kay.c
+++ b/src/ap/wpa_auth_kay.c
@@ -138,7 +138,6 @@ static unsigned int conf_offset_val(enum confidentiality_offset co)
 	switch (co) {
 	case CONFIDENTIALITY_OFFSET_30:
 		return 30;
-		break;
 	case CONFIDENTIALITY_OFFSET_50:
 		return 50;
 	default:
diff --git a/src/common/ctrl_iface_common.c b/src/common/ctrl_iface_common.c
index e26407dab..c82f26d40 100644
--- a/src/common/ctrl_iface_common.c
+++ b/src/common/ctrl_iface_common.c
@@ -69,8 +69,6 @@ static int sockaddr_compare(struct sockaddr_storage *a, socklen_t a_len,
 	default:
 		return 1;
 	}
-
-	return 0;
 }
 
 
diff --git a/wpa_supplicant/wpas_kay.c b/wpa_supplicant/wpas_kay.c
index defd0f2f7..51cab2df0 100644
--- a/wpa_supplicant/wpas_kay.c
+++ b/wpa_supplicant/wpas_kay.c
@@ -103,7 +103,6 @@ static unsigned int conf_offset_val(enum confidentiality_offset co)
 	switch (co) {
 	case CONFIDENTIALITY_OFFSET_30:
 		return 30;
-		break;
 	case CONFIDENTIALITY_OFFSET_50:
 		return 50;
 	default:
-- 
2.35.1




More information about the Hostap mailing list