[<prev] [next>] [day] [month] [year] [list]
Message-ID: <e2f00464-7570-0c40-7401-6bc99ae54ee2@suse.com>
Date: Tue, 8 Nov 2016 08:51:11 +0100
From: Juergen Gross <jgross@...e.com>
To: Jan Beulich <JBeulich@...e.com>,
David Vrabel <david.vrabel@...rix.com>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>
Cc: xen-devel <xen-devel@...ts.xenproject.org>,
lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] xen/manage: correct return value check on
xenbus_scanf()
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@...e.com>
Reviewed-by: Juergen Gross <jgross@...e.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;
>
>
Powered by blists - more mailing lists