[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <542A6411.5040201@gmail.com>
Date: Tue, 30 Sep 2014 16:04:33 +0800
From: Chen Gang <gang.chen.5i5j@...il.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
CC: David Vrabel <david.vrabel@...rix.com>, ian.campbell@...rix.com,
wei.liu2@...rix.com, boris.ostrovsky@...cle.com,
bhelgaas@...gle.com, jgross@...e.com,
yongjun_wei@...ndmicro.com.cn, mukesh.rathor@...cle.com,
xen-devel@...ts.xenproject.org,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
linux-pci@...r.kernel.org, linux-scsi@...r.kernel.org,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] xen/xenbus: Use 'void' instead of 'int' for the return
of xenbus_switch_state()
On 9/29/14 22:02, Konrad Rzeszutek Wilk wrote:
> On Sat, Sep 27, 2014 at 12:36:42AM +0800, Chen Gang wrote:
>> When xenbus_switch_state() fails, it will call xenbus_switch_fatal()
>
> Only on the first depth, not on the subsequent ones (as in if
> the first xenbus_switch_fail fails, it won't try to call
> xenbus_switch_state again and again).
>
Yeah, I guess you want to give more completion for this comment, do not
mean the original comments is incorrect.
[...]
>>
>> Also need be sure that all callers which check the return value must let
>> 'err' be 0.
>
> I am bit uncomfortable with that, that is due to:
>
>
> .. snip..
>> diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c
>> index 9c47b89..b5c3d47 100644
>> --- a/drivers/net/xen-netback/xenbus.c
>> +++ b/drivers/net/xen-netback/xenbus.c
>> @@ -337,10 +337,7 @@ static int netback_probe(struct xenbus_device *dev,
>> if (err)
>> pr_debug("Error writing multi-queue-max-queues\n");
>>
>> - err = xenbus_switch_state(dev, XenbusStateInitWait);
>> - if (err)
>> - goto fail;
>> -
>> + xenbus_switch_state(dev, XenbusStateInitWait);
>
> Which if it fails it won't call:
>
> 354 fail:
> 355 pr_debug("failed\n");
> 356 netback_remove(dev);
> 357 return err;
>
Originally, I intended left 'fail' code block for the next patch (which
I thought the next patch would need it).
Hmm... but any way, originally, I really need give additional comments
for it.
[...]
I skip all other contents which have already discussed by maintainers,
if I really miss something, please let me know.
Thanks.
--
Chen Gang
Open, share, and attitude like air, water, and life which God blessed
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists