From: "Jan Beulich" <JBeulich@suse.com>
To: "Boris Ostrovsky" <boris.ostrovsky@oracle.com>,
"Juergen Gross" <JGross@suse.com>
Cc: "xen-devel" <xen-devel@lists.xenproject.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH v2 RESEND] xen/manage: correct return value check on xenbus_scanf()
Date: Fri, 03 Feb 2017 01:54:05 -0700 [thread overview]
Message-ID: <5894533D02000078001366B0@prv-mh.provo.novell.com> (raw)
A negative return value indicates an error; in fact the function at
present won't ever return zero.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
---
v2: For consistency with other code don't consider zero an error
(utilizing that xenbus_scanf() at present won't return zero).
Adjust commit message accordingly.
---
drivers/xen/manage.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- 4.10-rc6/drivers/xen/manage.c
+++ 4.10-rc6-xen-manage-xenbus_scanf/drivers/xen/manage.c
@@ -277,7 +277,7 @@ static void sysrq_handler(struct xenbus_
err = xenbus_transaction_start(&xbt);
if (err)
return;
- if (!xenbus_scanf(xbt, "control", "sysrq", "%c", &sysrq_key)) {
+ if (xenbus_scanf(xbt, "control", "sysrq", "%c", &sysrq_key) < 0) {
pr_err("Unable to read sysrq code in control/sysrq\n");
xenbus_transaction_end(xbt, 1);
return;
next reply other threads:[~2017-02-03 8:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-03 8:54 Jan Beulich [this message]
2017-02-03 17:04 ` Boris Ostrovsky
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=5894533D02000078001366B0@prv-mh.provo.novell.com \
--to=jbeulich@suse.com \
--cc=JGross@suse.com \
--cc=boris.ostrovsky@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=xen-devel@lists.xenproject.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
all inboxes | Powered by JetHome®