From: Tvrtko Ursulin <tursulin@ursulin.net>
To: Intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t] lib: Fix igt_sysfs_set_u32 return value
Date: Fri, 29 Sep 2017 12:29:49 +0100 [thread overview]
Message-ID: <20170929112949.8414-1-tvrtko.ursulin@linux.intel.com> (raw)
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
next reply other threads:[~2017-09-29 11:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-29 11:29 Tvrtko Ursulin [this message]
2017-09-29 11:34 ` [PATCH i-g-t] lib: Fix igt_sysfs_set_u32 return value Chris Wilson
2017-09-29 12:03 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-09-29 14:43 ` ✗ Fi.CI.IGT: warning " 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=20170929112949.8414-1-tvrtko.ursulin@linux.intel.com \
--to=tursulin@ursulin.net \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox