xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: "Jürgen Groß" <jgross@suse.com>
Cc: linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	Julia Lawall <julia.lawall@lip6.fr>,
	David Vrabel <david.vrabel@citrix.com>,
	xen-devel@lists.xenproject.org,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: [PATCH 2/3] xen-scsiback: One function call less in scsiback_device_action() after error detection
Date: Tue, 19 Jul 2016 16:56:35 +0200	[thread overview]
Message-ID: <8806e9cb-4200-8154-7914-6735805dfbe0@users.sourceforge.net> (raw)
In-Reply-To: <fb5824ad-fb09-e471-7dc4-3e32564cc334@suse.com>

>> @@ -606,7 +606,7 @@ static void scsiback_device_action(struct vscsibk_pend *pending_req,
>>  	tmr = kzalloc(sizeof(struct scsiback_tmr), GFP_KERNEL);
>>  	if (!tmr) {
>>  		target_put_sess_cmd(se_cmd);
>> -		goto err;
>> +		goto do_resp;
>>  	}
> 
> Hmm, I'm not convinced this is an improvement.
> 
> I'd rather rename the new error label to "put_cmd" and get rid of the
> braces in above if statement:
> 
> -	if (!tmr) {
> -		target_put_sess_cmd(se_cmd);
> -		goto err;
> -	}
> +	if (!tmr)
> +		goto put_cmd;
> 
> and then in the error path:
> 
> -err:
> +put_cmd:
> +	target_put_sess_cmd(se_cmd);

I am unsure on the relevance of this function on such a source position.
Would it make sense to move it further down at the end?


> +free_tmr:
> 	kfree(tmr);

How do you think about to skip this function call after a memory
allocation failure?

Regards,
Markus

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2016-07-19 14:56 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5307CAA2.8060406@users.sourceforge.net>
     [not found] ` <alpine.DEB.2.02.1402212321410.2043@localhost6.localdomain6>
     [not found]   ` <530A086E.8010901@users.sourceforge.net>
     [not found]     ` <alpine.DEB.2.02.1402231635510.1985@localhost6.localdomain6>
     [not found]       ` <530A72AA.3000601@users.sourceforge.net>
     [not found]         ` <alpine.DEB.2.02.1402240658210.2090@localhost6.localdomain6>
     [not found]           ` <530B5FB6.6010207@users.sourceforge.net>
     [not found]             ` <alpine.DEB.2.10.1402241710370.2074@hadrien>
     [not found]               ` <530C5E18.1020800@users.sourceforge.net>
     [not found]                 ` <alpine.DEB.2.10.1402251014170.2080@hadrien>
     [not found]                   ` <530CD2C4.4050903@users.sourceforge.net>
     [not found]                     ` <alpine.DEB.2.10.1402251840450.7035@hadrien>
     [not found]                       ` <530CF8FF.8080600@users.sourceforge.net>
     [not found]                         ` <alpine.DEB.2.02.1402252117150.2047@localhost6.localdomain6>
     [not found]                           ` <530DD06F.4090703@users.sourceforge.net>
     [not found]                             ` <alpine.DEB.2.02.1402262129250.2221@localhost6.localdomain6>
     [not found]                               ` <5317A59D.4@users.sourceforge.net>
2014-11-02 15:12                                 ` [PATCH 1/1] PCI: Deletion of unnecessary checks before three function calls SF Markus Elfring
     [not found]                                 ` <545649DE.80304@users.sourceforge.net>
2014-11-11  4:07                                   ` Bjorn Helgaas
2016-07-16 20:20                                 ` [PATCH 0/3] xen-scsiback: Fine-tuning for scsiback_device_action() SF Markus Elfring
     [not found]                                 ` <59e51c7d-f7bb-c55f-d2fe-06dccfef6a99@users.sourceforge.net>
2016-07-16 20:22                                   ` [PATCH 1/3] xen-scsiback: Delete an unnecessary check before the function call "kfree" SF Markus Elfring
2016-07-16 20:23                                   ` [PATCH 2/3] xen-scsiback: One function call less in scsiback_device_action() after error detection SF Markus Elfring
2016-07-16 20:24                                   ` [PATCH 3/3] xen-scsiback: Pass a failure indication as a constant SF Markus Elfring
     [not found]                                   ` <fa839c03-b076-0264-c363-5581d0298632@users.sourceforge.net>
2016-07-18  5:01                                     ` [PATCH 1/3] xen-scsiback: Delete an unnecessary check before the function call "kfree" Juergen Gross
     [not found]                                   ` <e447cf62-ffc7-4b82-cff2-947c8874756a@users.sourceforge.net>
2016-07-18  5:05                                     ` [PATCH 3/3] xen-scsiback: Pass a failure indication as a constant Juergen Gross
     [not found]                                   ` <87e55a72-71ad-d0a1-b936-12565bbc6508@users.sourceforge.net>
2016-07-18  5:11                                     ` [PATCH 2/3] xen-scsiback: One function call less in scsiback_device_action() after error detection Juergen Gross
     [not found]                                     ` <fb5824ad-fb09-e471-7dc4-3e32564cc334@suse.com>
2016-07-19 14:56                                       ` SF Markus Elfring [this message]
2016-07-20  4:35                                         ` Juergen Gross
     [not found]                                         ` <83b0b1e2-900b-eefc-160b-7d837730571c@suse.com>
2016-07-20  5:10                                           ` SF Markus Elfring
2016-07-20  5:26                                             ` Juergen Gross
     [not found]                                             ` <85b948e0-bf37-dff0-6792-77b5dacef9a0@suse.com>
2016-07-20 11:27                                               ` [PATCH v2 0/3] xen-scsiback: Fine-tuning for scsiback_device_action() SF Markus Elfring
2016-07-20 11:30                                                 ` [PATCH v2 1/3] xen-scsiback: Delete an unnecessary check before the function call "kfree" SF Markus Elfring
2016-07-20 11:44                                                   ` Juergen Gross
2016-07-20 11:34                                                 ` [PATCH v2 2/3] xen-scsiback: Rename jump labels in scsiback_device_action() SF Markus Elfring
2016-07-20 11:45                                                   ` Juergen Gross
2016-07-20 11:36                                                 ` [PATCH v2 3/3] xen-scsiback: Pass a failure indication as a constant SF Markus Elfring
2016-07-20 11:44                                                   ` Juergen Gross

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=8806e9cb-4200-8154-7914-6735805dfbe0@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=boris.ostrovsky@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=jgross@suse.com \
    --cc=julia.lawall@lip6.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@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;
as well as URLs for NNTP newsgroup(s).