]> err.no Git - linux-2.6/commitdiff
[PATCH] selinux: more ARRAY_SIZE cleanups
authorTobias Klauser <tklauser@nuerscht.ch>
Fri, 6 Jan 2006 08:11:23 +0000 (00:11 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 6 Jan 2006 16:33:29 +0000 (08:33 -0800)
Further ARRAY_SIZE cleanups under security/selinux.

Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch>
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Acked-by: James Morris <jmorris@namei.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
security/selinux/ss/avtab.c
security/selinux/ss/policydb.c

index dde094feb20dfb5976b8e215db975b61f14df1c3..d049c7acbc8bc9b5a03853eeeb0496ac0901ee45 100644 (file)
@@ -359,7 +359,7 @@ int avtab_read_item(void *fp, u32 vers, struct avtab *a,
                        return -1;
                }
 
-               for (i = 0; i < sizeof(spec_order)/sizeof(u16); i++) {
+               for (i = 0; i < ARRAY_SIZE(spec_order); i++) {
                        if (val & spec_order[i]) {
                                key.specified = spec_order[i] | enabled;
                                datum.data = le32_to_cpu(buf32[items++]);
index 0ac311dc8371ecd540168f200c535ae4a6f7ac12..0111990ba8378e6ac8222817f92b188aa50ea299 100644 (file)
@@ -103,7 +103,7 @@ static struct policydb_compat_info *policydb_lookup_compat(int version)
        int i;
        struct policydb_compat_info *info = NULL;
 
-       for (i = 0; i < sizeof(policydb_compat)/sizeof(*info); i++) {
+       for (i = 0; i < ARRAY_SIZE(policydb_compat); i++) {
                if (policydb_compat[i].version == version) {
                        info = &policydb_compat[i];
                        break;