tree-wide: replace for loop with FOREACH_ELEMENT or FOREACH_ARRAY macros (#34893)

This commit is contained in:
Integral
2024-10-26 07:10:22 +09:00
committed by GitHub
parent f7078de515
commit ddb8a639d5
46 changed files with 249 additions and 269 deletions
+4 -4
View File
@@ -74,12 +74,12 @@ static const char *translate_runlevel(int runlevel, bool *isolate) {
assert(isolate);
for (size_t i = 0; i < ELEMENTSOF(table); i++)
if (table[i].runlevel == runlevel) {
*isolate = table[i].isolate;
FOREACH_ELEMENT(i, table)
if (i->runlevel == runlevel) {
*isolate = i->isolate;
if (runlevel == '6' && kexec_loaded())
return SPECIAL_KEXEC_TARGET;
return table[i].special;
return i->special;
}
return NULL;