aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/ss/services.c
diff options
context:
space:
mode:
authorVesa-Matti Kari <vmkari@cc.helsinki.fi>2008-08-06 20:18:20 -0400
committerJames Morris <jmorris@namei.org>2008-08-14 18:40:47 -0400
commitdbc74c65b3fd841985935f676388c82d6b85c485 (patch)
tree8ebbf88795fa70f56a9eb64bfc0b21dd8666d97f /security/selinux/ss/services.c
parent421fae06be9e0dac45747494756b3580643815f9 (diff)
selinux: Unify for- and while-loop style
Replace "thing != NULL" comparisons with just "thing" to make the code look more uniform (mixed styles were used even in the same source file). Signed-off-by: Vesa-Matti Kari <vmkari@cc.helsinki.fi> Acked-by: Stephen Smalley <sds@tycho.nsa.gov> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/selinux/ss/services.c')
-rw-r--r--security/selinux/ss/services.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
index b52f923ce680..5a0536bddc63 100644
--- a/security/selinux/ss/services.c
+++ b/security/selinux/ss/services.c
@@ -356,7 +356,7 @@ static int context_struct_compute_av(struct context *scontext,
356 avkey.source_type = i + 1; 356 avkey.source_type = i + 1;
357 avkey.target_type = j + 1; 357 avkey.target_type = j + 1;
358 for (node = avtab_search_node(&policydb.te_avtab, &avkey); 358 for (node = avtab_search_node(&policydb.te_avtab, &avkey);
359 node != NULL; 359 node;
360 node = avtab_search_node_next(node, avkey.specified)) { 360 node = avtab_search_node_next(node, avkey.specified)) {
361 if (node->key.specified == AVTAB_ALLOWED) 361 if (node->key.specified == AVTAB_ALLOWED)
362 avd->allowed |= node->datum.data; 362 avd->allowed |= node->datum.data;
@@ -1037,7 +1037,7 @@ static int security_compute_sid(u32 ssid,
1037 /* If no permanent rule, also check for enabled conditional rules */ 1037 /* If no permanent rule, also check for enabled conditional rules */
1038 if (!avdatum) { 1038 if (!avdatum) {
1039 node = avtab_search_node(&policydb.te_cond_avtab, &avkey); 1039 node = avtab_search_node(&policydb.te_cond_avtab, &avkey);
1040 for (; node != NULL; node = avtab_search_node_next(node, specified)) { 1040 for (; node; node = avtab_search_node_next(node, specified)) {
1041 if (node->key.specified & AVTAB_ENABLED) { 1041 if (node->key.specified & AVTAB_ENABLED) {
1042 avdatum = &node->datum; 1042 avdatum = &node->datum;
1043 break; 1043 break;
@@ -2050,7 +2050,7 @@ int security_set_bools(int len, int *values)
2050 policydb.bool_val_to_struct[i]->state = 0; 2050 policydb.bool_val_to_struct[i]->state = 0;
2051 } 2051 }
2052 2052
2053 for (cur = policydb.cond_list; cur != NULL; cur = cur->next) { 2053 for (cur = policydb.cond_list; cur; cur = cur->next) {
2054 rc = evaluate_cond_node(&policydb, cur); 2054 rc = evaluate_cond_node(&policydb, cur);
2055 if (rc) 2055 if (rc)
2056 goto out; 2056 goto out;
@@ -2102,7 +2102,7 @@ static int security_preserve_bools(struct policydb *p)
2102 if (booldatum) 2102 if (booldatum)
2103 booldatum->state = bvalues[i]; 2103 booldatum->state = bvalues[i];
2104 } 2104 }
2105 for (cur = p->cond_list; cur != NULL; cur = cur->next) { 2105 for (cur = p->cond_list; cur; cur = cur->next) {
2106 rc = evaluate_cond_node(p, cur); 2106 rc = evaluate_cond_node(p, cur);
2107 if (rc) 2107 if (rc)
2108 goto out; 2108 goto out;