mirror of https://gitee.com/openkylin/linux.git
staging:iio:Documentation: cleanup properly in buffer handling code
Eating the endian description for now. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
014fcb1db5
commit
a7f7c364e8
|
@ -145,9 +145,17 @@ inline int iioutils_get_type(unsigned *is_signed,
|
||||||
ret = -errno;
|
ret = -errno;
|
||||||
goto error_free_filename;
|
goto error_free_filename;
|
||||||
}
|
}
|
||||||
fscanf(sysfsfp,
|
|
||||||
"%c%u/%u>>%u", &signchar, bits_used,
|
ret = fscanf(sysfsfp,
|
||||||
&padint, shift);
|
"%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;
|
*bytes = padint / 8;
|
||||||
if (*bits_used == 64)
|
if (*bits_used == 64)
|
||||||
*mask = ~0;
|
*mask = ~0;
|
||||||
|
@ -157,6 +165,10 @@ inline int iioutils_get_type(unsigned *is_signed,
|
||||||
*is_signed = 1;
|
*is_signed = 1;
|
||||||
else
|
else
|
||||||
*is_signed = 0;
|
*is_signed = 0;
|
||||||
|
fclose(sysfsfp);
|
||||||
|
free(filename);
|
||||||
|
|
||||||
|
filename = 0;
|
||||||
}
|
}
|
||||||
error_free_filename:
|
error_free_filename:
|
||||||
if (filename)
|
if (filename)
|
||||||
|
|
Loading…
Reference in New Issue