From: Michael Hennerich Date: Thu, 24 Feb 2011 15:34:54 +0000 (+0100) Subject: IIO: Documentation: iio_utils: fix mask generation X-Git-Tag: MMI-PSA29.97-13-9~20521^2~400 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fc7f95a94606fd81d8a3910c1477ea7340b52b9f;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Acked-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/iio/Documentation/iio_utils.h b/drivers/staging/iio/Documentation/iio_utils.h index bde231352a87..1b33c040bad7 100644 --- a/drivers/staging/iio/Documentation/iio_utils.h +++ b/drivers/staging/iio/Documentation/iio_utils.h @@ -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;