From patchwork Fri Aug 21 14:49:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 7052321 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B0220C05AD for ; Fri, 21 Aug 2015 14:50:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D38202060C for ; Fri, 21 Aug 2015 14:50:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F40D82052C for ; Fri, 21 Aug 2015 14:50:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752347AbbHUOuF (ORCPT ); Fri, 21 Aug 2015 10:50:05 -0400 Received: from mail-yk0-f177.google.com ([209.85.160.177]:33416 "EHLO mail-yk0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752261AbbHUOuF (ORCPT ); Fri, 21 Aug 2015 10:50:05 -0400 Received: by ykll84 with SMTP id l84so72374926ykl.0 for ; Fri, 21 Aug 2015 07:50:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NyO9STKgS1cNxr4/zjkEFQXCHR3uHjFXTrlBzOUuXF8=; b=Gq2YxWO1MBiTEL3Ay9fMxuVmrtwXYB6oqSIo8eq0okLfXw0S/MbAXmULNYXH+gwff6 L/qk6zui85IDPbxkwOkippfEtPZ4TISYgr+AauxUa1b8mwQZUvHyk/Ajt7J6bLpQWHiT fe7QoxkVE/KxUz8hNmhFfh18mykMQQdlr+X9VnRwNwmpXjzex1FMeF1AxoUg5s1AZbKf aR8DsIAUOcVeVI3CKOwTg49/hnb+62ulljbva9hQrwq3XyaQYDuBHNRgCg1AAL30fkWf VhwT7BVbAfJspw5dJHqou4zI2PoNLH41ZcdpdfxGZJL5CMY+2ml5rHZWSMtg8hKMPr0U 4A7A== X-Received: by 10.170.65.67 with SMTP id h64mr11845586ykh.122.1440168604552; Fri, 21 Aug 2015 07:50:04 -0700 (PDT) Received: from localhost.localdomain ([187.64.230.54]) by smtp.gmail.com with ESMTPSA id d23sm7573899ywb.16.2015.08.21.07.50.02 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 21 Aug 2015 07:50:04 -0700 (PDT) From: Fabio Estevam To: herbert@gondor.apana.org.au Cc: vicki.milhoan@freescale.com, horia.geanta@freescale.com, linux-crypto@vger.kernel.org, Fabio Estevam Subject: [PATCH 4/4] crypto: caam: ctrl: Use devm_kcalloc() Date: Fri, 21 Aug 2015 11:49:30 -0300 Message-Id: <1440168570-13635-4-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1440168570-13635-1-git-send-email-festevam@gmail.com> References: <1440168570-13635-1-git-send-email-festevam@gmail.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Fabio Estevam From Documentation/CodingStyle: "The preferred form for allocating a zeroed array is the following: p = kcalloc(n, sizeof(...), ...); " , so do as suggested. Signed-off-by: Fabio Estevam --- drivers/crypto/caam/ctrl.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c index aab8b2a..c9c5892 100644 --- a/drivers/crypto/caam/ctrl.c +++ b/drivers/crypto/caam/ctrl.c @@ -581,9 +581,8 @@ static int caam_probe(struct platform_device *pdev) of_device_is_compatible(np, "fsl,sec4.0-job-ring")) rspec++; - ctrlpriv->jrpdev = devm_kzalloc(&pdev->dev, - sizeof(struct platform_device *) * rspec, - GFP_KERNEL); + ctrlpriv->jrpdev = devm_kcalloc(&pdev->dev, rspec, + sizeof(*ctrlpriv->jrpdev), GFP_KERNEL); if (ctrlpriv->jrpdev == NULL) { ret = -ENOMEM; goto iounmap_ctrl;