tools: iio: Add ARRAY_SIZE macro
[linux-2.6-microblaze.git] / tools / iio / iio_utils.c
index 4a7e480..e177f40 100644 (file)
@@ -39,7 +39,7 @@ int iioutils_break_up_name(const char *full_name, char **generic_name)
        char *working, *prefix = "";
        int i, ret;
 
-       for (i = 0; i < sizeof(iio_direction) / sizeof(iio_direction[0]); i++)
+       for (i = 0; i < ARRAY_SIZE(iio_direction); i++)
                if (!strncmp(full_name, iio_direction[i],
                             strlen(iio_direction[i]))) {
                        prefix = iio_direction[i];