mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-09 17:06:14 +00:00
pm_rps: Add read back checking on sysfs writes
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
e07e758004
commit
0102b6bde6
@ -68,15 +68,20 @@ static int readval(FILE *filp)
|
||||
|
||||
static int do_writeval(FILE *filp, int val, int lerrno)
|
||||
{
|
||||
int ret;
|
||||
int ret, orig;
|
||||
|
||||
orig = readval(filp);
|
||||
rewind(filp);
|
||||
ret = fprintf(filp, "%d", val);
|
||||
|
||||
if (lerrno) {
|
||||
/* Expecting specific error */
|
||||
igt_assert(ret == EOF && errno == lerrno);
|
||||
igt_assert(readval(filp) == orig);
|
||||
} else {
|
||||
/* Expecting no error */
|
||||
igt_assert(ret != EOF);
|
||||
igt_assert(readval(filp) == val);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
Loading…
x
Reference in New Issue
Block a user