Skip to content

Commit

Permalink
IIO: Documentation: iio_utils: fix mask generation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Hennerich authored and Greg Kroah-Hartman committed Feb 28, 2011
1 parent 7ccd450 commit fc7f95a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/iio/Documentation/iio_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit fc7f95a

Please sign in to comment.