From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752477AbeAEQt6 (ORCPT + 1 other); Fri, 5 Jan 2018 11:49:58 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:39141 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752208AbeAEQt4 (ORCPT ); Fri, 5 Jan 2018 11:49:56 -0500 X-Google-Smtp-Source: ACJfBovbb8UZgjTizfk1w5Szgn70lk9+YqJZyLmr6cJE2hgW2pQgHOrGjbTi4tySQc6WXsypBuU2nw== From: Sumit Pundir 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 Message-Id: <1515170987-29587-1-git-send-email-pundirsumit11@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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 --- 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