Skip to content

Commit

Permalink
staging:iio:Documentation: cleanup properly in buffer handling code
Browse files Browse the repository at this point in the history
Eating the endian description for now.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Dec 8, 2011
1 parent 014fcb1 commit a7f7c36
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions drivers/staging/iio/Documentation/iio_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,17 @@ inline int iioutils_get_type(unsigned *is_signed,
ret = -errno;
goto error_free_filename;
}
fscanf(sysfsfp,
"%c%u/%u>>%u", &signchar, bits_used,
&padint, shift);

ret = fscanf(sysfsfp,
"%ce:%c%u/%u>>%u",
&endianchar,
&signchar,
bits_used,
&padint, shift);
if (ret < 0) {
printf("failed to pass scan type description\n");
return ret;
}
*bytes = padint / 8;
if (*bits_used == 64)
*mask = ~0;
Expand All @@ -157,6 +165,10 @@ inline int iioutils_get_type(unsigned *is_signed,
*is_signed = 1;
else
*is_signed = 0;
fclose(sysfsfp);
free(filename);

filename = 0;
}
error_free_filename:
if (filename)
Expand Down

0 comments on commit a7f7c36

Please sign in to comment.