netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chen Gang <gang.chen.5i5j@gmail.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: David Vrabel <david.vrabel@citrix.com>,
	ian.campbell@citrix.com, wei.liu2@citrix.com,
	boris.ostrovsky@oracle.com, bhelgaas@google.com, jgross@suse.com,
	yongjun_wei@trendmicro.com.cn, mukesh.rathor@oracle.com,
	xen-devel@lists.xenproject.org,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	linux-pci@vger.kernel.org, linux-scsi@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] xen/xenbus: Use 'void' instead of 'int' for the return of xenbus_switch_state()
Date: Tue, 30 Sep 2014 16:04:33 +0800	[thread overview]
Message-ID: <542A6411.5040201@gmail.com> (raw)
In-Reply-To: <20140929140229.GA28279@laptop.dumpdata.com>

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

  parent reply	other threads:[~2014-09-30  8:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-26 16:36 [PATCH] xen/xenbus: Use 'void' instead of 'int' for the return of xenbus_switch_state() Chen Gang
2014-09-26 18:07 ` [Xen-devel] " David Vrabel
2014-09-27  9:20   ` Chen Gang
2014-09-29  8:41   ` Wei Liu
2014-09-29 14:03   ` Konrad Rzeszutek Wilk
2014-09-29  5:09 ` Juergen Gross
2014-09-29 13:35 ` Bjorn Helgaas
2014-09-29 14:02 ` Konrad Rzeszutek Wilk
2014-09-29 14:17   ` David Vrabel
2014-09-29 15:40     ` Konrad Rzeszutek Wilk
2014-09-29 17:14       ` David Vrabel
2014-09-30  8:04   ` Chen Gang [this message]
2014-09-30  9:55 ` David Vrabel
2014-09-30 10:10   ` Chen Gang

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=542A6411.5040201@gmail.com \
    --to=gang.chen.5i5j@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=jgross@suse.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mukesh.rathor@oracle.com \
    --cc=netdev@vger.kernel.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    --cc=yongjun_wei@trendmicro.com.cn \
    /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;
as well as URLs for NNTP newsgroup(s).