All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bart.vanassche@sandisk.com>
To: ding.yemin@zte.com.cn,
	Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: zhang.kai16@zte.com.cn, dm-devel@redhat.com, tang.junhui@zte.com.cn
Subject: Re: [PATCH] Remove duplicated code in mpath_alloc_prin_response()
Date: Fri, 28 Oct 2016 08:16:18 -0700	[thread overview]
Message-ID: <4109416b-9d3c-9b31-90bc-1f8695d9aca9@sandisk.com> (raw)
In-Reply-To: <1477383563-10684-1-git-send-email-ding.yemin@zte.com.cn>

On 10/25/2016 01:19 AM, ding.yemin@zte.com.cn wrote:
>  	}
> +	if (size > 0)
> +	{
> +		ptr = malloc(size);
> +		if (ptr)
> +		{
> +			memset(ptr, 0, size);
> +		}
> +	}
>  	return ptr;
>  }

Hello Ding Yemin,

Please use calloc() instead of open coding it.

Thanks,

Bart.

  reply	other threads:[~2016-10-28 15:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-25  8:19 [PATCH] Remove duplicated code in mpath_alloc_prin_response() ding.yemin
2016-10-28 15:16 ` Bart Van Assche [this message]
2016-10-31  2:03   ` ding.yemin
2016-10-31  2:55 ding.yemin

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=4109416b-9d3c-9b31-90bc-1f8695d9aca9@sandisk.com \
    --to=bart.vanassche@sandisk.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=ding.yemin@zte.com.cn \
    --cc=dm-devel@redhat.com \
    --cc=tang.junhui@zte.com.cn \
    --cc=zhang.kai16@zte.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.