summaryrefslogtreecommitdiff
path: root/tools/iio
diff options
context:
space:
mode:
authorHartmut Knaack <knaack.h@gmx.de>2015-05-31 15:40:19 +0300
committerJonathan Cameron <jic23@kernel.org>2015-06-01 10:35:29 +0300
commit33ebcb21a67f257faf1128f08a6d7c0299cb0da2 (patch)
tree4f781e6e3efd54bfa19d026d968f92e86a32a951 /tools/iio
parent916e89e4b7272e1eda9eba057cf25197129bcf79 (diff)
downloadlinux-33ebcb21a67f257faf1128f08a6d7c0299cb0da2.tar.xz
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);