linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 1/1] mmc/card/queue.c: change action when the condition of if is true
       [not found] <1351169953-7734-1-git-send-email-windsdaemon@gmail.com>
@ 2012-10-26 11:09 ` Venkatraman S
  0 siblings, 0 replies; only message in thread
From: Venkatraman S @ 2012-10-26 11:09 UTC (permalink / raw)
  To: Wang.Jing.windsdaemon
  Cc: Chris Ball, Namjae Jeon, Jaehoon Chung, Adrian Hunter, linux-mmc,
	Jing Wang

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;
>   }
>   


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-10-26 11:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1351169953-7734-1-git-send-email-windsdaemon@gmail.com>
2012-10-26 11:09 ` [PATCH 1/1] mmc/card/queue.c: change action when the condition of if is true Venkatraman S

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).