selinux: fix warning Comparison to bool
PATCH 1/1 selinux: fix warning Comparison to bool
fix below warnings reported by coccicheck
security/selinux/ss/mls.c:539:39-43: WARNING: Comparison to bool security/selinux/ss/services.c:1815:46-50: WARNING: Comparison to bool security/selinux/ss/services.c:1827:46-50: WARNING: Comparison to bool
Reported-by Hulk Robot <[email protected]>
Signed-off-by Zou Wei <[email protected]>
--- security/selinux/ss/mls.c | 2 +- security/selinux/ss/services.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
security/selinux/ss/mls.c +1 -1
@@ -536,7 +536,7 @@ int mls_compute_sid(struct policydb *p,/* Fallthrough */ case AVTAB_CHANGE : -if ((tclass == p->process_class) || (sock == true)) +if ((tclass == p->process_class) || sock)/* Use the process MLS attributes. */ return mls_context_cpy (newcontext, scontext);else
security/selinux/ss/services.c +2 -2
@@ -1812,7 +1812,7 @@ static int security_compute_sid(struct selinux_state *state, }else if (cladatum && cladatum->default_role ==DEFAULT_TARGET ) { newcontext.role = tcontext->role; }else { -if ((tclass == policydb->process_class) || (sock == true)) +if ((tclass == policydb->process_class) || sock) newcontext.role = scontext->role;else newcontext.role =OBJECT_R_VAL ;
@@ -1824,7 +1824,7 @@ static int security_compute_sid(struct selinux_state *state, }else if (cladatum && cladatum->default_type ==DEFAULT_TARGET ) { newcontext.type = tcontext->type; }else { -if ((tclass == policydb->process_class) || (sock == true)) { +if ((tclass == policydb->process_class) || sock) {/* Use the type of process. */ newcontext.type = scontext->type; }else {
Signature · 1 line
2.6.2
Quoted 7 lines · Zou Wei
fix below warnings reported by coccicheck
security/selinux/ss/mls.c:539:39-43: WARNING: Comparison to bool security/selinux/ss/services.c:1815:46-50: WARNING: Comparison to bool security/selinux/ss/services.c:1827:46-50: WARNING: Comparison to bool
Quoted 6 lines
Reported-by Hulk Robot <[email protected]>Signed-off-by Zou Wei <[email protected]>--- security/selinux/ss/mls.c | 2 +- security/selinux/ss/services.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
Merged into selinux/next, thanks.
Signature · 2 lines
paul moore www.paul-moore.com