IIO: Documentation: iio_utils: fix mask generation

Variable sizeint is used uninitialized.
Remove sizeint completely and use bits_used instead.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Michael Hennerich 2011-02-24 16:34:54 +01:00 committed by Greg Kroah-Hartman
parent 7ccd4506fa
commit fc7f95a946

View File

@ -113,7 +113,7 @@ inline int iioutils_get_type(unsigned *is_signed,
DIR *dp; DIR *dp;
char *scan_el_dir, *builtname, *builtname_generic, *filename = 0; char *scan_el_dir, *builtname, *builtname_generic, *filename = 0;
char signchar; char signchar;
unsigned sizeint, padint; unsigned padint;
const struct dirent *ent; const struct dirent *ent;
ret = asprintf(&scan_el_dir, FORMAT_SCAN_ELEMENTS_DIR, device_dir); 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, fscanf(sysfsfp,
"%c%u/%u", &signchar, bits_used, &padint); "%c%u/%u", &signchar, bits_used, &padint);
*bytes = padint / 8; *bytes = padint / 8;
if (sizeint == 64) if (*bits_used == 64)
*mask = ~0; *mask = ~0;
else else
*mask = (1 << *bits_used) - 1; *mask = (1 << *bits_used) - 1;