summaryrefslogtreecommitdiff
path: root/tools/iio
diff options
context:
space:
mode:
Diffstat (limited to 'tools/iio')
-rw-r--r--tools/iio/generic_buffer.c2
-rw-r--r--tools/iio/iio_utils.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/tools/iio/generic_buffer.c b/tools/iio/generic_buffer.c
index 8f8f058eb807..f805493be3eb 100644
--- a/tools/iio/generic_buffer.c
+++ b/tools/iio/generic_buffer.c
@@ -71,7 +71,7 @@ void print2byte(int input, struct iio_channel_info *info)
* Shift before conversion to avoid sign extension
* of left aligned data
*/
- input = input >> info->shift;
+ input >>= info->shift;
if (info->is_signed) {
int16_t val = input;
diff --git a/tools/iio/iio_utils.c b/tools/iio/iio_utils.c
index aea928210187..2680a2e0f113 100644
--- a/tools/iio/iio_utils.c
+++ b/tools/iio/iio_utils.c
@@ -6,6 +6,8 @@
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*/
+#ifndef _IIO_UTILS_H
+#define _IIO_UTILS_H
#include <string.h>
#include <stdlib.h>
@@ -649,3 +651,5 @@ error_free:
free(temp);
return ret;
}
+
+#endif /* _IIO_UTILS_H */