summaryrefslogtreecommitdiff
path: root/src/udev/udev-builtin.c
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2012-04-16 03:13:22 +0200
committerKay Sievers <kay@vrfy.org>2012-04-16 19:20:57 +0200
commit8fef0ff25c9fd7e5bb99d66f43c6357e4996a3cc (patch)
tree8b570d9685b12ad1210c9ed857c18fa4e2e00913 /src/udev/udev-builtin.c
parentb59e246565337d6c6967059dd15a52a15277433e (diff)
udev: replace ARRAY_SIZE() with ELEMENTSOF()
Diffstat (limited to 'src/udev/udev-builtin.c')
-rw-r--r--src/udev/udev-builtin.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/udev/udev-builtin.c b/src/udev/udev-builtin.c
index 508a22ecf8..b8cdc708bc 100644
--- a/src/udev/udev-builtin.c
+++ b/src/udev/udev-builtin.c
@@ -44,7 +44,7 @@ int udev_builtin_init(struct udev *udev)
unsigned int i;
int err;
- for (i = 0; i < ARRAY_SIZE(builtins); i++) {
+ for (i = 0; i < ELEMENTSOF(builtins); i++) {
if (builtins[i]->init) {
err = builtins[i]->init(udev);
if (err < 0)
@@ -58,7 +58,7 @@ void udev_builtin_exit(struct udev *udev)
{
unsigned int i;
- for (i = 0; i < ARRAY_SIZE(builtins); i++)
+ for (i = 0; i < ELEMENTSOF(builtins); i++)
if (builtins[i]->exit)
builtins[i]->exit(udev);
}
@@ -68,7 +68,7 @@ bool udev_builtin_validate(struct udev *udev)
unsigned int i;
bool change = false;
- for (i = 0; i < ARRAY_SIZE(builtins); i++)
+ for (i = 0; i < ELEMENTSOF(builtins); i++)
if (builtins[i]->validate)
if (builtins[i]->validate(udev))
change = true;
@@ -79,7 +79,7 @@ void udev_builtin_list(struct udev *udev)
{
unsigned int i;
- for (i = 0; i < ARRAY_SIZE(builtins); i++)
+ for (i = 0; i < ELEMENTSOF(builtins); i++)
fprintf(stderr, " %-12s %s\n", builtins[i]->name, builtins[i]->help);
}
@@ -103,7 +103,7 @@ enum udev_builtin_cmd udev_builtin_lookup(const char *command)
pos = strchr(name, ' ');
if (pos)
pos[0] = '\0';
- for (i = 0; i < ARRAY_SIZE(builtins); i++)
+ for (i = 0; i < ELEMENTSOF(builtins); i++)
if (strcmp(builtins[i]->name, name) == 0)
return i;
return UDEV_BUILTIN_MAX;