From 33ebcb21a67f257faf1128f08a6d7c0299cb0da2 Mon Sep 17 00:00:00 2001 From: Hartmut Knaack Date: Sun, 31 May 2015 14:40:19 +0200 Subject: 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 Signed-off-by: Jonathan Cameron --- tools/iio/iio_utils.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'tools/iio') diff --git a/tools/iio/iio_utils.c b/tools/iio/iio_utils.c index 0524725..c83f4df 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); -- cgit v1.1