[PATCH 26/32] tools:iio:iio_utils: refactor assignment of is_signed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
---
 tools/iio/iio_utils.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

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);
-- 
2.3.6

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux