All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michal Wajdeczko" <michal.wajdeczko@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, Daniel Vetter <daniel@ffwll.ch>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH i-g-t v2] lib/igt_sysfs: Let igt_sysfs_read|write return -errno
Date: Wed, 13 Dec 2017 15:16:02 +0100	[thread overview]
Message-ID: <op.za6u80ybxaggs7@mwajdecz-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <20171207210048.molvmgmlwsqlkrwp@phenom.ffwll.local>

On Thu, 07 Dec 2017 22:00:48 +0100, Daniel Vetter <daniel@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@intel.com>
>> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
>> > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>> Reviewed-by: Chris Wilson <chris@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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-12-13 14:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-07 16:52 [PATCH i-g-t v2] lib/igt_sysfs: Let igt_sysfs_read|write return -errno Michal Wajdeczko
2017-12-07 16:59 ` Chris Wilson
2017-12-07 21:00   ` Daniel Vetter
2017-12-13 14:16     ` Michal Wajdeczko [this message]
2017-12-15 11:28   ` Chris Wilson
2017-12-07 19:26 ` ✓ Fi.CI.BAT: success for lib/igt_sysfs: Let igt_sysfs_read|write return -errno (rev2) Patchwork
2017-12-07 23:00 ` ✗ Fi.CI.IGT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=op.za6u80ybxaggs7@mwajdecz-mobl1.ger.corp.intel.com \
    --to=michal.wajdeczko@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.