From 4fbc018a279a39160f17e257017b503194a7f44d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Tue, 8 Jun 2021 17:59:10 +0200 Subject: [PATCH] libsepol: drop unnecessary casts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `hashtab_search()` does take `const_hashtab_key_t` as second parameter, which is a typedef for `const char *`. Drop the unnecessary and const-violating cast. Signed-off-by: Christian Göttsche Acked-by: James Carter --- libsepol/src/services.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libsepol/src/services.c b/libsepol/src/services.c index f7c31d80..47a3dc14 100644 --- a/libsepol/src/services.c +++ b/libsepol/src/services.c @@ -1182,7 +1182,7 @@ int sepol_string_to_security_class(const char *class_name, class_datum_t *tclass_datum; tclass_datum = hashtab_search(policydb->p_classes.table, - (hashtab_key_t) class_name); + class_name); if (!tclass_datum) { ERR(NULL, "unrecognized class %s", class_name); return STATUS_ERR; @@ -1211,7 +1211,7 @@ int sepol_string_to_av_perm(sepol_security_class_t tclass, /* Check for unique perms then the common ones (if any) */ perm_datum = (perm_datum_t *) hashtab_search(tclass_datum->permissions.table, - (hashtab_key_t)perm_name); + perm_name); if (perm_datum != NULL) { *av = 0x1 << (perm_datum->s.value - 1); return STATUS_SUCCESS; @@ -1222,7 +1222,7 @@ int sepol_string_to_av_perm(sepol_security_class_t tclass, perm_datum = (perm_datum_t *) hashtab_search(tclass_datum->comdatum->permissions.table, - (hashtab_key_t)perm_name); + perm_name); if (perm_datum != NULL) { *av = 0x1 << (perm_datum->s.value - 1);