linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Venkatraman S <svenkatr@ti.com>
To: Wang.Jing.windsdaemon@gmail.com
Cc: Chris Ball <cjb@laptop.org>, Namjae Jeon <linkinjeon@gmail.com>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	linux-mmc@vger.kernel.org, Jing Wang <windsdaemon@gmail.com>
Subject: Re: [PATCH 1/1] mmc/card/queue.c: change action when the condition of if is true
Date: Fri, 26 Oct 2012 16:39:37 +0530	[thread overview]
Message-ID: <508A6F71.40404@ti.com> (raw)
In-Reply-To: <1351169953-7734-1-git-send-email-windsdaemon@gmail.com>

On Thursday 25 October 2012 06:29 PM, Wang.Jing.windsdaemon@gmail.com wrote:
> From: Jing Wang <windsdaemon@gmail.com>
Some description of the actual effect of the change here would be nice.
For example, "Trim the error handling path in mmc_alloc_sg".
But what's the point of this patch anyway ? There are 2 "return" statements
instead of one.
>
> Signed-off-by: Jing Wang <windsdaemon@gmail.com>
> ---
>   drivers/mmc/card/queue.c |    9 +++++----
>   1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
> index e360a97..98a22a1 100644
> --- a/drivers/mmc/card/queue.c
> +++ b/drivers/mmc/card/queue.c
> @@ -118,13 +118,14 @@ static struct scatterlist *mmc_alloc_sg(int sg_len, int *err)
>   	struct scatterlist *sg;
>   
>   	sg = kmalloc(sizeof(struct scatterlist)*sg_len, GFP_KERNEL);
> -	if (!sg)
> +	if (!sg) {
>   		*err = -ENOMEM;
> -	else {
> -		*err = 0;
> -		sg_init_table(sg, sg_len);
> +		return sg;
>   	}
>   
> +	*err = 0;
> +	sg_init_table(sg, sg_len);
> +
>   	return sg;
>   }
>   


           reply	other threads:[~2012-10-26 11:09 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1351169953-7734-1-git-send-email-windsdaemon@gmail.com>]

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=508A6F71.40404@ti.com \
    --to=svenkatr@ti.com \
    --cc=Wang.Jing.windsdaemon@gmail.com \
    --cc=adrian.hunter@intel.com \
    --cc=cjb@laptop.org \
    --cc=jh80.chung@samsung.com \
    --cc=linkinjeon@gmail.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=windsdaemon@gmail.com \
    /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).