Commit fc7f95a9 authored by Michael Hennerich's avatar Michael Hennerich Committed by Greg Kroah-Hartman

IIO: Documentation: iio_utils: fix mask generation

Variable sizeint is used uninitialized.
Remove sizeint completely and use bits_used instead.
Signed-off-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Acked-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7ccd4506
......@@ -113,7 +113,7 @@ inline int iioutils_get_type(unsigned *is_signed,
DIR *dp;
char *scan_el_dir, *builtname, *builtname_generic, *filename = 0;
char signchar;
unsigned sizeint, padint;
unsigned padint;
const struct dirent *ent;
ret = asprintf(&scan_el_dir, FORMAT_SCAN_ELEMENTS_DIR, device_dir);
......@@ -159,7 +159,7 @@ inline int iioutils_get_type(unsigned *is_signed,
fscanf(sysfsfp,
"%c%u/%u", &signchar, bits_used, &padint);
*bytes = padint / 8;
if (sizeint == 64)
if (*bits_used == 64)
*mask = ~0;
else
*mask = (1 << *bits_used) - 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment