summaryrefslogtreecommitdiff
path: root/tools/iio/iio_utils.c
diff options
context:
space:
mode:
authorCristina Opriceana <cristina.opriceana@gmail.com>2015-07-13 16:20:11 +0300
committerJonathan Cameron <jic23@kernel.org>2015-07-20 20:41:23 +0300
commit34cbea1908fb686b037e01e5b1ab8e0e67b09ed3 (patch)
tree7c6186632a1e254502f133a8c4b94a25a45faa57 /tools/iio/iio_utils.c
parent37d38e2bcce055c3988977429dc4336c866df73d (diff)
downloadlinux-34cbea1908fb686b037e01e5b1ab8e0e67b09ed3.tar.xz
tools: iio: Add ARRAY_SIZE macro
Calculation of the length of an array can be done with the ARRAY_SIZE macro to make code more abstract and remove the associated checkpatch.pl warning. Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Acked-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'tools/iio/iio_utils.c')
-rw-r--r--tools/iio/iio_utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/iio/iio_utils.c b/tools/iio/iio_utils.c
index 4a7e4801cebf..e177f4022d40 100644
--- a/tools/iio/iio_utils.c
+++ b/tools/iio/iio_utils.c
@@ -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];