public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] lib: Fix igt_sysfs_set_u32 return value
@ 2017-09-29 11:29 Tvrtko Ursulin
  2017-09-29 11:34 ` Chris Wilson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tvrtko Ursulin @ 2017-09-29 11:29 UTC (permalink / raw)
  To: Intel-gfx

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Printf family functions return a number of bytes, not tokens,
printed so the existing check (== 1) was wrong.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 lib/igt_sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c
index 817678bc28ed..6f03008b14a5 100644
--- a/lib/igt_sysfs.c
+++ b/lib/igt_sysfs.c
@@ -463,7 +463,7 @@ uint32_t igt_sysfs_get_u32(int dir, const char *attr)
  */
 bool igt_sysfs_set_u32(int dir, const char *attr, uint32_t value)
 {
-	return igt_sysfs_printf(dir, attr, "%u", value) == 1;
+	return igt_sysfs_printf(dir, attr, "%u", value) > 0;
 }
 
 /**
-- 
2.9.5

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-29 14:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-29 11:29 [PATCH i-g-t] lib: Fix igt_sysfs_set_u32 return value Tvrtko Ursulin
2017-09-29 11:34 ` Chris Wilson
2017-09-29 12:03 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-09-29 14:43 ` ✗ Fi.CI.IGT: warning " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox