diff mbox series

[07/47] libsemanage: drop unnecessary return statements

Message ID 20241111141706.38039-7-cgoettsche@seltendoof.de (mailing list archive)
State New
Delegated to: Petr Lautrbach
Headers show
Series [01/47] libsemanage: white space cleanup | expand

Commit Message

Christian Göttsche Nov. 11, 2024, 2:16 p.m. UTC
From: Christian Göttsche <cgzones@googlemail.com>

Drop return statements at end of void functions and drop one unreachable
return statement (compilers that can't infer it is unreachable should
just not be used).

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
 libsemanage/src/debug.c  | 1 -
 libsemanage/src/handle.c | 9 ---------
 2 files changed, 10 deletions(-)
diff mbox series

Patch

diff --git a/libsemanage/src/debug.c b/libsemanage/src/debug.c
index 902ab5a5..1e375694 100644
--- a/libsemanage/src/debug.c
+++ b/libsemanage/src/debug.c
@@ -107,7 +107,6 @@  void semanage_msg_relay_handler(void *varg,
 	sh->msg_channel = sepol_msg_get_channel(sepolh);
 	sh->msg_level = sepol_msg_get_level(sepolh);	/* XXX should map values */
 	sh->msg_callback(sh->msg_callback_arg, sh, "%s", buffer);
-	return;
 }
 
 extern void semanage_msg_set_callback(semanage_handle_t * handle,
diff --git a/libsemanage/src/handle.c b/libsemanage/src/handle.c
index c489a75f..d5baa614 100644
--- a/libsemanage/src/handle.c
+++ b/libsemanage/src/handle.c
@@ -194,7 +194,6 @@  void semanage_set_create_store(semanage_handle_t * sh, int create_store)
 	assert(sh != NULL);
 
 	sh->create_store = create_store;
-	return;
 }
 
 int semanage_get_disable_dontaudit(semanage_handle_t * sh)
@@ -209,7 +208,6 @@  void semanage_set_disable_dontaudit(semanage_handle_t * sh, int disable_dontaudi
 	assert(sh != NULL);
 
 	sepol_set_disable_dontaudit(sh->sepolh, disable_dontaudit);
-	return;
 }
 
 int semanage_get_preserve_tunables(semanage_handle_t * sh)
@@ -244,7 +242,6 @@  void semanage_set_check_contexts(semanage_handle_t * sh, int do_check_contexts)
 	assert(sh != NULL);
 
 	sh->do_check_contexts = do_check_contexts;
-	return;
 }
 
 uint16_t semanage_get_default_priority(semanage_handle_t *sh)
@@ -285,8 +282,6 @@  void semanage_select_store(semanage_handle_t * sh, char *storename,
 	sh->conf->store_path = strdup(storename);
 	assert(sh->conf->store_path); /* no way to return failure */
 	sh->conf->store_type = storetype;
-
-	return;
 }
 
 void semanage_set_store_root(semanage_handle_t *sh, const char *store_root)
@@ -296,8 +291,6 @@  void semanage_set_store_root(semanage_handle_t *sh, const char *store_root)
 	free(sh->conf->store_root_path);
 	sh->conf->store_root_path = strdup(store_root);
 	assert(sh->conf->store_root_path); /* no way to return failure */
-
-	return;
 }
 
 int semanage_is_managed(semanage_handle_t * sh)
@@ -361,8 +354,6 @@  int semanage_access_check(semanage_handle_t * sh)
 	default:
 		return -1;
 	}
-
-	return -1;		/* unreachable */
 }