mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
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>
This commit is contained in:
parent
37d38e2bcc
commit
34cbea1908
2 changed files with 3 additions and 1 deletions
|
@ -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];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue