[Intel-gfx] [PATCH i-g-t v2] lib/igt_sysfs: Let igt_sysfs_read|write return -errno
Michal Wajdeczko
michal.wajdeczko at intel.com
Wed Dec 13 14:16:02 UTC 2017
On Thu, 07 Dec 2017 22:00:48 +0100, Daniel Vetter <daniel at ffwll.ch> wrote:
> On Thu, Dec 07, 2017 at 04:59:36PM +0000, Chris Wilson wrote:
>> Quoting Michal Wajdeczko (2017-12-07 16:52:46)
>> > In some cases debugfs or sysfs may return errors that we
>> > want to check. Return -errno from helper functions to make
>> > asserts easier.
>> >
>> > v2: don't forget about EOF ret=0 (Chris)
>> > small re-write (Michal)
>> >
>> > Signed-off-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
>> > Cc: Chris Wilson <chris at chris-wilson.co.uk>
>> > Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
>> Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
>>
>> Just tests/drv_hangman.c needs to fixed to use
>> igt_require(sysfs >= 0);
>
> Isn't the usual igt pattern that igt_foo never fails, and __igt_foo gives
> you the error code? But I guess we can do that later on in follow-ups.
I'm not sure that this pattern is applicable here as igt_sysfs_read() was
already returning some data or error indicator. The only change is that
now we return len/-errno (instead len/-1)
Michal
More information about the Intel-gfx
mailing list