From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754519AbdEHMgK (ORCPT ); Mon, 8 May 2017 08:36:10 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:33616 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750911AbdEHMgJ (ORCPT ); Mon, 8 May 2017 08:36:09 -0400 From: karthik@techveda.org To: rmfrfs@gmail.com, johan@kernel.org, elder@kernel.org, gregkh@linuxfoundation.org Cc: greybus-dev@lists.linaro.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, sunil.m@techveda.org, Karthik Tummala Subject: [PATCH v2] Staging: greybus: light: Prefer kcalloc over kzalloc Date: Mon, 8 May 2017 18:05:55 +0530 Message-Id: <1494246955-14245-1-git-send-email-karthik@techveda.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <20170508103542.GA1089@arch-late.localdomain> References: <20170508103542.GA1089@arch-late.localdomain> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Karthik Tummala Fixed following checkpatch.pl warning: * WARNING: Prefer kcalloc over kzalloc with multiply Instead of specifying no.of bytes * size as argument in kzalloc, prefer kcalloc. Signed-off-by: Karthik Tummala Reviewed-by: Rui Miguel Silva --- Changes for v2: - Changed subject line & fixed typo as suggested by Rui Miguel Silva --- drivers/staging/greybus/light.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c index 1681362..861a249 100644 --- a/drivers/staging/greybus/light.c +++ b/drivers/staging/greybus/light.c @@ -1030,7 +1030,7 @@ static int gb_lights_light_config(struct gb_lights *glights, u8 id) light->channels_count = conf.channel_count; light->name = kstrndup(conf.name, NAMES_MAX, GFP_KERNEL); - light->channels = kzalloc(light->channels_count * + light->channels = kcalloc(light->channels_count, sizeof(struct gb_channel), GFP_KERNEL); if (!light->channels) return -ENOMEM; @@ -1167,7 +1167,7 @@ static int gb_lights_create_all(struct gb_lights *glights) if (ret < 0) goto out; - glights->lights = kzalloc(glights->lights_count * + glights->lights = kcalloc(glights->lights_count, sizeof(struct gb_light), GFP_KERNEL); if (!glights->lights) { ret = -ENOMEM; -- 1.9.1