summaryrefslogtreecommitdiffstats
path: root/tools/iio
diff options
context:
space:
mode:
authorHartmut Knaack <knaack.h@gmx.de>2015-05-31 14:40:19 +0200
committerJonathan Cameron <jic23@kernel.org>2015-06-01 09:35:29 +0200
commit33ebcb21a67f257faf1128f08a6d7c0299cb0da2 (patch)
tree4f781e6e3efd54bfa19d026d968f92e86a32a951 /tools/iio
parenttools:iio:iio_event_monitor: refactor events output (diff)
downloadlinux-33ebcb21a67f257faf1128f08a6d7c0299cb0da2.tar.xz
linux-33ebcb21a67f257faf1128f08a6d7c0299cb0da2.zip
tools:iio:iio_utils: refactor assignment of is_signed
Change the assignment of *is_signed in iioutils_get_type() to a one-liner, as already done with *be. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'tools/iio')
-rw-r--r--tools/iio/iio_utils.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/tools/iio/iio_utils.c b/tools/iio/iio_utils.c
index 0524725279bb..c83f4dfe71d6 100644
--- a/tools/iio/iio_utils.c
+++ b/tools/iio/iio_utils.c
@@ -168,10 +168,7 @@ int iioutils_get_type(unsigned *is_signed,
*mask = ~0;
else
*mask = (1 << *bits_used) - 1;
- if (signchar == 's')
- *is_signed = 1;
- else
- *is_signed = 0;
+ *is_signed = (signchar == 's');
if (fclose(sysfsfp)) {
ret = -errno;
printf("Failed to close %s\n", filename);