linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sumit Pundir <pundirsumit11@gmail.com>
To: oleg.drokin@intel.com
Cc: andreas.dilger@intel.com, jsimmons@infradead.org,
	gregkh@linuxfoundation.org, lustre-devel@lists.lustre.org,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH] Staging: lustre: Fix prefer kcalloc over kzalloc with multiply
Date: Fri,  5 Jan 2018 22:19:47 +0530	[thread overview]
Message-ID: <1515170987-29587-1-git-send-email-pundirsumit11@gmail.com> (raw)

Use kcalloc for allocating an array instead of kzalloc with
multiply. kcalloc is the preferred API. Issue reported by
checkpatch.pl

Signed-off-by: Sumit Pundir <pundirsumit11@gmail.com>
---
 drivers/staging/lustre/lustre/obdclass/cl_object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_object.c b/drivers/staging/lustre/lustre/obdclass/cl_object.c
index fdd27ce..4b10e2f 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_object.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_object.c
@@ -1017,7 +1017,7 @@ int cl_global_init(void)
 {
 	int result;
 
-	cl_envs = kzalloc(sizeof(*cl_envs) * num_possible_cpus(), GFP_KERNEL);
+	cl_envs = kcalloc(num_possible_cpus(), sizeof(*cl_envs), GFP_KERNEL);
 	if (!cl_envs) {
 		result = -ENOMEM;
 		goto out;
-- 
2.7.4

                 reply	other threads:[~2018-01-05 16:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1515170987-29587-1-git-send-email-pundirsumit11@gmail.com \
    --to=pundirsumit11@gmail.com \
    --cc=andreas.dilger@intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jsimmons@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lustre-devel@lists.lustre.org \
    --cc=oleg.drokin@intel.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).