[PATCH 3/5] libsepol: remove useless assignments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There is no point in initializing a variable which gets
almost-immediately assigned an other value.

Signed-off-by: Nicolas Iooss <nicolas.iooss@xxxxxxx>
---
 libsepol/cil/src/cil_binary.c | 2 --
 libsepol/src/write.c          | 1 -
 2 files changed, 3 deletions(-)

diff --git a/libsepol/cil/src/cil_binary.c b/libsepol/cil/src/cil_binary.c
index aaad364efce7..19cbc1b87c1e 100644
--- a/libsepol/cil/src/cil_binary.c
+++ b/libsepol/cil/src/cil_binary.c
@@ -2253,7 +2253,6 @@ int cil_roletrans_to_policydb(policydb_t *pdb, const struct cil_db *db, struct c
 				new->tclass = sepol_obj->s.value;
 				new->new_role = sepol_result->s.value;
 
-				rc = SEPOL_OK;
 				rc = hashtab_insert(role_trans_table, (hashtab_key_t)new, &(new->new_role));
 				if (rc != SEPOL_OK) {
 					if (rc == SEPOL_EEXIST) {
@@ -3041,7 +3040,6 @@ int cil_rangetransition_to_policydb(policydb_t *pdb, const struct cil_db *db, st
 					goto exit;
 				}
 
-				rc = SEPOL_OK;
 				rc = hashtab_insert(range_trans_table, (hashtab_key_t)newkey, newdatum);
 				if (rc != SEPOL_OK) {
 					if (rc == SEPOL_EEXIST) {
diff --git a/libsepol/src/write.c b/libsepol/src/write.c
index c4c84ac48062..e75b9abc381c 100644
--- a/libsepol/src/write.c
+++ b/libsepol/src/write.c
@@ -926,7 +926,6 @@ static int write_cons_helper(policydb_t * p,
 		if (items != 2)
 			return POLICYDB_ERROR;
 		for (e = c->expr; e; e = e->next) {
-			items = 0;
 			buf[0] = cpu_to_le32(e->expr_type);
 			buf[1] = cpu_to_le32(e->attr);
 			buf[2] = cpu_to_le32(e->op);
-- 
2.11.0

_______________________________________________
Selinux mailing list
Selinux@xxxxxxxxxxxxx
To unsubscribe, send email to Selinux-leave@xxxxxxxxxxxxx.
To get help, send an email containing "help" to Selinux-request@xxxxxxxxxxxxx.



[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux