summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorEva Rachel Retuya <eraretuya@gmail.com>2016-10-20 12:19:23 +0300
committerJonathan Cameron <jic23@kernel.org>2016-10-23 21:34:10 +0300
commit71ccbe5dc566021ec5f810917bec7312527e421e (patch)
tree65b27bd91e126b89aca843c9deae6d47a59cb9ff /tools
parent0b0feb34175d57a342846a13d2072446fd3bcdde (diff)
downloadlinux-71ccbe5dc566021ec5f810917bec7312527e421e.tar.xz
tools: iio: iio_generic_buffer: rename and change type of force variable
Replace the type of 'force' flag from int to bool and at the same time rename it to 'force_autochannels' for better readability. Suggested-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/iio/iio_generic_buffer.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/iio/iio_generic_buffer.c b/tools/iio/iio_generic_buffer.c
index 31ddd3abe04f..8ef39ae9858f 100644
--- a/tools/iio/iio_generic_buffer.c
+++ b/tools/iio/iio_generic_buffer.c
@@ -348,7 +348,7 @@ int main(int argc, char **argv)
int noevents = 0;
int notrigger = 0;
char *dummy;
- int force = 0;
+ bool force_autochannels = false;
struct iio_channel_info *channels = NULL;
@@ -362,7 +362,7 @@ int main(int argc, char **argv)
break;
case 'A':
autochannels = AUTOCHANNELS_ENABLED;
- force = 1;
+ force_autochannels = true;
break;
case 'c':
errno = 0;
@@ -526,14 +526,15 @@ int main(int argc, char **argv)
"diag %s\n", dev_dir_name);
goto error;
}
- if ((num_channels && autochannels == AUTOCHANNELS_ENABLED) && !force) {
+ if ((num_channels && autochannels == AUTOCHANNELS_ENABLED) &&
+ !force_autochannels) {
fprintf(stderr, "Auto-channels selected but some channels "
"are already activated in sysfs\n");
fprintf(stderr, "Proceeding without activating any channels\n");
}
if ((!num_channels && autochannels == AUTOCHANNELS_ENABLED) ||
- ((autochannels == AUTOCHANNELS_ENABLED) && force)) {
+ ((autochannels == AUTOCHANNELS_ENABLED) && force_autochannels)) {
fprintf(stderr, "Enabling all channels\n");
ret = enable_disable_all_channels(dev_dir_name, 1);