mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roger Pau Monne <roger.pau@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	<xen-devel@lists.xenproject.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] xen-blkfront: prefer xenbus_scanf() over xenbus_gather()
Date: Thu, 7 Jul 2016 11:40:39 +0200	[thread overview]
Message-ID: <20160707094038.c3d5ebbvyj4vm73n@mac> (raw)
In-Reply-To: <577E297A02000078000FBF20@prv-mh.provo.novell.com>

On Thu, Jul 07, 2016 at 02:05:46AM -0600, Jan Beulich wrote:
> ... for single items being collected: It is more typesafe (as the
> compiler can check format string and to-be-written-to variable match)
> and requires one less parameter to be passed.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Roger Pau Monné <roger.pau@citrix.com>

> ---
>  drivers/block/xen-blkfront.c |   43 +++++++++++++++++++------------------------
>  1 file changed, 19 insertions(+), 24 deletions(-)
> 
> --- 4.7-rc6-prefer-xenbus_scanf.orig/drivers/block/xen-blkfront.c
> +++ 4.7-rc6-prefer-xenbus_scanf/drivers/block/xen-blkfront.c
> @@ -2208,10 +2208,9 @@ static void blkfront_setup_discard(struc
>  		info->discard_granularity = discard_granularity;
>  		info->discard_alignment = discard_alignment;
>  	}
> -	err = xenbus_gather(XBT_NIL, info->xbdev->otherend,
> -		    "discard-secure", "%d", &discard_secure,
> -		    NULL);
> -	if (!err)
> +	err = xenbus_scanf(XBT_NIL, info->xbdev->otherend,
> +			   "discard-secure", "%u", &discard_secure);
> +	if (err > 0)

I would prefer an explicit err == 1 check (here and elsewhere), but I'm not 
going to block this patch because of that.

Roger.

      reply	other threads:[~2016-07-07  9:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-07  8:05 Jan Beulich
2016-07-07  9:40 ` Roger Pau Monne [this message]

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=20160707094038.c3d5ebbvyj4vm73n@mac \
    --to=roger.pau@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=konrad.wilk@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®