From: David Vrabel <david.vrabel@citrix.com>
To: David Vrabel <david.vrabel@citrix.com>,
Jan Beulich <JBeulich@suse.com>,
Roger Pau Monne <roger.pau@citrix.com>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: <xen-devel@lists.xenproject.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH] xen-blkback: prefer xenbus_write() over xenbus_printf() where possible
Date: Thu, 7 Jul 2016 11:43:26 +0100 [thread overview]
Message-ID: <577E324E.9000808@citrix.com> (raw)
In-Reply-To: <577E2E3A.60803@citrix.com>
On 07/07/16 11:26, David Vrabel wrote:
> On 07/07/16 09:06, Jan Beulich wrote:
>> ... as being the simpler variant.
> [...]
>> --- 4.7-rc6-prefer-xenbus_write.orig/drivers/block/xen-blkback/xenbus.c
>> +++ 4.7-rc6-prefer-xenbus_write/drivers/block/xen-blkback/xenbus.c
>> @@ -617,9 +617,9 @@ static int xen_blkbk_probe(struct xenbus
>> goto fail;
>> }
>>
>> - err = xenbus_printf(XBT_NIL, dev->nodename,
>> - "feature-max-indirect-segments", "%u",
>> - MAX_INDIRECT_SEGMENTS);
>> + err = xenbus_write(XBT_NIL, dev->nodename,
>> + "feature-max-indirect-segments",
>> + __stringify(MAX_INDIRECT_SEGMENTS));
>
> Yuk :(
>
> Now someone has to check both __stringify() and MAX_INDIRECT_SEGMENTS to
> work out what this actually looks like.
In particular, if we ended up with
#define MAX_INDIRECT_SEGMENTS 512u
or similar then the code is now wrong.
David
prev parent reply other threads:[~2016-07-07 10:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-07 8:06 [PATCH] xen-blkback: prefer xenbus_write() over xenbus_printf() where possible Jan Beulich
2016-07-07 9:42 ` Roger Pau Monne
2016-07-07 9:42 ` Roger Pau Monne
2016-07-07 10:26 ` David Vrabel
2016-07-07 10:26 ` [Xen-devel] " David Vrabel
2016-07-07 10:43 ` David Vrabel
2016-07-07 10:43 ` David Vrabel [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=577E324E.9000808@citrix.com \
--to=david.vrabel@citrix.com \
--cc=JBeulich@suse.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=roger.pau@citrix.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.