]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
Use last enum value instead of ARRAY_SIZE
authorLucas De Marchi <lucas.demarchi@profusion.mobi>
Sat, 31 Dec 2011 15:01:55 +0000 (13:01 -0200)
committerLucas De Marchi <lucas.demarchi@profusion.mobi>
Sat, 31 Dec 2011 21:30:09 +0000 (19:30 -0200)
libkmod/libkmod.c

index 163de3ff06882779feabb9eb46c578b1185ff9c5..b4db9a517351b1f0c63da5227bfa99a6e35d9513 100644 (file)
@@ -632,7 +632,7 @@ KMOD_EXPORT int kmod_load_resources(struct kmod_ctx *ctx)
        if (ctx == NULL)
                return -ENOENT;
 
-       for (i = 0; i < ARRAY_SIZE(index_files); i++) {
+       for (i = 0; i < _KMOD_INDEX_LAST; i++) {
                char path[PATH_MAX];
 
                if (ctx->indexes[i] != NULL) {
@@ -676,7 +676,7 @@ KMOD_EXPORT void kmod_unload_resources(struct kmod_ctx *ctx)
        if (ctx == NULL)
                return;
 
-       for (i = 0; i < ARRAY_SIZE(index_files); i++) {
+       for (i = 0; i < _KMOD_INDEX_LAST; i++) {
                if (ctx->indexes[i] != NULL) {
                        index_mm_close(ctx->indexes[i]);
                        ctx->indexes[i] = NULL;