]> git.karo-electronics.de Git - linux-beck.git/commitdiff
IIO: Documentation: iio_utils: fix mask generation
authorMichael Hennerich <michael.hennerich@analog.com>
Thu, 24 Feb 2011 15:34:54 +0000 (16:34 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 28 Feb 2011 22:40:24 +0000 (14:40 -0800)
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>
drivers/staging/iio/Documentation/iio_utils.h

index bde231352a87c2b8a66cd96cb56347c57c8589f4..1b33c040bad7b7b5b864312a56ec32d8175e2e64 100644 (file)
@@ -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;