From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933353AbcJRHOb (ORCPT ); Tue, 18 Oct 2016 03:14:31 -0400 Received: from mail4.hitachi.co.jp ([133.145.228.5]:49023 "EHLO mail4.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932339AbcJRHOW (ORCPT ); Tue, 18 Oct 2016 03:14:22 -0400 From: Nobuhiro Iwamatsu To: Anton Vorontsov , Colin Cross , Kees Cook , Tony Luck Cc: linux-kernel@vger.kernel.org, cti.systems-productivity-manager.ts@hitachi.com, Nobuhiro Iwamatsu , Mark Salyzyn , Seiji Aguchi , Shuah Khan Subject: [PATCH v3 1/8] pstore: Replace four kzalloc() calls by kcalloc() in ramoops_init_przs() Date: Tue, 18 Oct 2016 16:13:27 +0900 Message-Id: <1476774814-6840-2-git-send-email-nobuhiro.iwamatsu.kw@hitachi.com> X-Mailer: git-send-email 2.8.1.windows.1 In-Reply-To: <1476774814-6840-1-git-send-email-nobuhiro.iwamatsu.kw@hitachi.com> References: <1476774814-6840-1-git-send-email-nobuhiro.iwamatsu.kw@hitachi.com> X-TM-AS-GCONF: 00 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The script "checkpatch.pl" can point information out like the following. WARNING: Prefer kcalloc over kzalloc with multiply Thus fix the affected source code places. Signed-off-by: Nobuhiro Iwamatsu Cc: Anton Vorontsov Cc: Colin Cross Cc: Kees Cook Cc: Mark Salyzyn Cc: Seiji Aguchi Cc: Shuah Khan Cc: Tony Luck V3: New patch. --- fs/pstore/ram.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index 6ad831b..0bef455 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c @@ -424,8 +424,8 @@ static int ramoops_init_przs(struct device *dev, struct ramoops_context *cxt, if (!cxt->max_dump_cnt) return -ENOMEM; - cxt->przs = kzalloc(sizeof(*cxt->przs) * cxt->max_dump_cnt, - GFP_KERNEL); + cxt->przs = kcalloc(cxt->max_dump_cnt, sizeof(*cxt->przs), + GFP_KERNEL); if (!cxt->przs) { dev_err(dev, "failed to initialize a prz array for dumps\n"); goto fail_mem; -- 2.9.3