summaryrefslogtreecommitdiff
path: root/tools/iio/iio_utils.h
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 18:41:23 +0100
commit34cbea1908fb686b037e01e5b1ab8e0e67b09ed3 (patch)
tree7c6186632a1e254502f133a8c4b94a25a45faa57 /tools/iio/iio_utils.h
parent37d38e2bcce055c3988977429dc4336c866df73d (diff)
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.h')
-rw-r--r--tools/iio/iio_utils.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/iio/iio_utils.h b/tools/iio/iio_utils.h
index 086610139ade..f30a1091b53e 100644
--- a/tools/iio/iio_utils.h
+++ b/tools/iio/iio_utils.h
@@ -18,6 +18,8 @@
#define FORMAT_SCAN_ELEMENTS_DIR "%s/scan_elements"
#define FORMAT_TYPE_FILE "%s_type"
+#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))
+
extern const char *iio_dir;
/**