Skip to contentSkip to conversation

lib/igt_sysfs: Return errno from igt_sysfs_printf

PATCH In review Katarzyna Dec 3 participants 5 messages Aug 29, 2018 – Aug 30, 2018 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/igt_sysfs: Return errno from igt_sysfs_printf

Let's add returning errno on failure instead of -1.

Cc Daniele Ceraolo Spurio <[email protected]>
---
 lib/igt_sysfs.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
lib/igt_sysfs.c +3 -1
index 8efe889b..6cc7ba44 100644
@@ -417,7 +417,7 @@ int igt_sysfs_vprintf(int dir, const char *attr, const char *fmt, va_list ap)
  * printf() wrapper for sysfs.
  *
  * Returns:
- * Number of characters written, negative value on error.
+ * Number of characters written, errno on error.
  */
 int igt_sysfs_printf(int dir, const char *attr, const char *fmt, ...)
 {
@@ -427,6 +427,8 @@ int igt_sysfs_printf(int dir, const char *attr, const char *fmt, ...)
 	va_start(ap, fmt);
 	ret = igt_sysfs_vprintf(dir, attr, fmt, ap);
 	va_end(ap);
+	if (ret < 0)
+		return errno;
 
 	return ret;
 }
Signature · 6 lines
2.17.1

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#3 lore raw

[igt-dev] ✓ Fi.CI.IGT: success for lib/igt_sysfs: Return errno from igt_sysfs_printf

In reply to Katarzyna Dec
== Series Details ==

== Series Details ==

Series: lib/igt_sysfs: Return errno from igt_sysfs_printf
URL : https://patchwork.freedesktop.org/series/48874/
State : success

== Summary ==

= CI Bug Log - changes from IGT_4610_full -> IGTPW_1754_full =

== Summary - WARNING ==

Minor unknown changes coming with IGTPW_1754_full need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in IGTPW_1754_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://patchwork.freedesktop.org/api/1.0/series/48874/revisions/1/mbox/

== Possible new issues ==

Here are the unknown changes that may have been introduced in IGTPW_1754_full:

=== IGT changes ===

    ==== Warnings ====

    igt@kms_draw_crc@draw-method-xrgb2101010-mmap-wc-untiled:
      shard-snb:          SKIP -> PASS

    igt@kms_vblank@pipe-a-query-idle-hang:
      shard-snb:          PASS -> SKIP +4

== Known issues ==

Here are the changes found in IGTPW_1754_full that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@gem_exec_big:
      shard-hsw:          PASS -> INCOMPLETE (fdo#103540)

    igt@gem_exec_fence@basic-await-default:
      shard-snb:          PASS -> INCOMPLETE (fdo#105411)

    igt@kms_flip@flip-vs-expired-vblank:
      shard-glk:          PASS -> FAIL (fdo#105363, fdo#102887)

    igt@kms_plane@pixel-format-pipe-a-planes:
      shard-snb:          PASS -> FAIL (fdo#107161)

    igt@kms_plane_scaling@pipe-a-scaler-with-clipping-clamping:
      shard-kbl:          PASS -> DMESG-WARN (fdo#105604)

    igt@kms_setmode@basic:
      shard-glk:          NOTRUN -> FAIL (fdo#99912)
      shard-kbl:          PASS -> FAIL (fdo#99912)

    
    ==== Possible fixes ====

    igt@gem_ctx_isolation@vcs0-s3:
      shard-kbl:          INCOMPLETE (fdo#103665, fdo#107556) -> PASS

    igt@gem_ctx_isolation@vcs1-none:
      shard-snb:          INCOMPLETE (fdo#105411) -> SKIP

    igt@gem_ppgtt@blt-vs-render-ctx0:
      shard-kbl:          INCOMPLETE (fdo#103665, fdo#106023) -> PASS

    igt@kms_plane_multiple@atomic-pipe-a-tiling-x:
      shard-snb:          FAIL (fdo#103166) -> PASS

    igt@kms_setmode@basic:
      shard-apl:          FAIL (fdo#99912) -> PASS

fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
fdo#103540 https://bugs.freedesktop.org/show_bug.cgi?id=103540
fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
fdo#105604 https://bugs.freedesktop.org/show_bug.cgi?id=105604
fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023
fdo#107161 https://bugs.freedesktop.org/show_bug.cgi?id=107161
fdo#107556 https://bugs.freedesktop.org/show_bug.cgi?id=107556
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912

== Participating hosts (5 -> 5) ==

No changes in participating hosts

== Build changes ==

* IGT: IGT_4610 -> IGTPW_1754
* Linux: CI_DRM_4706 -> CI_DRM_4715

CI_DRM_4706: 6d5687919f3a3426243041b99111b576dd0576d0 @ git://anongit.freedesktop.org/gfx-ci/linux
CI_DRM_4715: 1b73a69651beab39192502181c83e77a1022014a @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_1754: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1754/
IGT_4610: c40743d3fce5055682d31610519758dd7379c0f8 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1754/shards.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#2 lore raw
In reply to Chris Wilson
Quoted 6 lines · Chris Wilson

Quoting Katarzyna Dec (2018-08-29 14:13:49)

Quoted 1 line

Let's add returning errno on failure instead of -1.

But not as a positive value and not from that function. vprintf is not documented as setting errno.
-Chris

You're right about positive value, my bet. And after more digging into code it looks like the only function that could return errno is open(), vprintf/vfprinf return only negative value. I think it could be better to leave it as it is now.

Kasia

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#4 lore raw

[igt-dev] ✓ Fi.CI.BAT: success for lib/igt_sysfs: Return errno from igt_sysfs_printf

In reply to Katarzyna Dec
== Series Details ==

== Series Details ==

Series: lib/igt_sysfs: Return errno from igt_sysfs_printf
URL : https://patchwork.freedesktop.org/series/48874/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4715 -> IGTPW_1754 =

== Summary - SUCCESS ==

No regressions found.

External URL: https://patchwork.freedesktop.org/api/1.0/series/48874/revisions/1/mbox/

== Possible new issues ==

Here are the unknown changes that may have been introduced in IGTPW_1754:

=== IGT changes ===

    ==== Possible regressions ====

    {igt@pm_rpm@module-reload}:
      fi-kbl-7567u:       PASS -> FAIL

== Known issues ==

Here are the changes found in IGTPW_1754 that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@drv_selftest@live_hangcheck:
      fi-skl-guc:         PASS -> DMESG-FAIL (fdo#107710, fdo#107174)
      fi-kbl-7567u:       PASS -> DMESG-FAIL (fdo#106947, fdo#106560)

    igt@kms_chamelium@dp-edid-read:
      fi-kbl-7500u:       PASS -> FAIL (fdo#103841)

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
      fi-snb-2520m:       NOTRUN -> INCOMPLETE (fdo#103713)

    
    ==== Possible fixes ====

    igt@debugfs_test@read_all_entries:
      fi-snb-2520m:       INCOMPLETE (fdo#103713) -> PASS

    {igt@pm_rpm@module-reload}:
      fi-cnl-psr:         WARN (fdo#107708, fdo#107602) -> PASS

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#103841 https://bugs.freedesktop.org/show_bug.cgi?id=103841
fdo#106560 https://bugs.freedesktop.org/show_bug.cgi?id=106560
fdo#106947 https://bugs.freedesktop.org/show_bug.cgi?id=106947
fdo#107174 https://bugs.freedesktop.org/show_bug.cgi?id=107174
fdo#107602 https://bugs.freedesktop.org/show_bug.cgi?id=107602
fdo#107708 https://bugs.freedesktop.org/show_bug.cgi?id=107708
fdo#107710 https://bugs.freedesktop.org/show_bug.cgi?id=107710

== Participating hosts (53 -> 48) ==

Additional (1): fi-bxt-dsi
Missing (6): fi-hsw-4770r fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600

== Build changes ==

* IGT: IGT_4610 -> IGTPW_1754

CI_DRM_4715: 1b73a69651beab39192502181c83e77a1022014a @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_1754: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1754/
IGT_4610: c40743d3fce5055682d31610519758dd7379c0f8 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1754/issues.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev