* Re: [PATCH v2] xen/manage: correct return value check on xenbus_scanf()
[not found] <58219077020000780011CF59@suse.com>
@ 2016-11-08 7:51 ` Juergen Gross
0 siblings, 0 replies; 2+ messages in thread
From: Juergen Gross @ 2016-11-08 7:51 UTC (permalink / raw)
To: Jan Beulich, David Vrabel, Boris Ostrovsky; +Cc: xen-devel, lkml
On 08/11/16 08:44, Jan Beulich wrote:
> 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.9-rc4/drivers/xen/manage.c
> +++ 4.9-rc4-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;
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH v2] xen/manage: correct return value check on xenbus_scanf()
@ 2016-11-08 7:44 Jan Beulich
0 siblings, 0 replies; 2+ messages in thread
From: Jan Beulich @ 2016-11-08 7:44 UTC (permalink / raw)
To: david.vrabel, boris.ostrovsky, Juergen Gross; +Cc: xen-devel, linux-kernel
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>
---
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.9-rc4/drivers/xen/manage.c
+++ 4.9-rc4-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;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-11-08 7:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <58219077020000780011CF59@suse.com>
2016-11-08 7:51 ` [PATCH v2] xen/manage: correct return value check on xenbus_scanf() Juergen Gross
2016-11-08 7:44 Jan Beulich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).