From fc7f95a94606fd81d8a3910c1477ea7340b52b9f Mon Sep 17 00:00:00 2001 From: Michael Hennerich Date: Thu, 24 Feb 2011 16:34:54 +0100 Subject: [PATCH] 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 --- drivers/staging/iio/Documentation/iio_utils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.20.1