提交 fc7f95a9 编写于 作者: M Michael Hennerich 提交者: 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: NMichael Hennerich <michael.hennerich@analog.com>
Acked-by: NJonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册