From patchwork Thu Sep 15 03:28:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9332799 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5FDE4607FD for ; Thu, 15 Sep 2016 03:28:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 50056287B9 for ; Thu, 15 Sep 2016 03:28:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 41E0E290B4; Thu, 15 Sep 2016 03:28:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C9B60287B9 for ; Thu, 15 Sep 2016 03:28:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755074AbcIOD2M (ORCPT ); Wed, 14 Sep 2016 23:28:12 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:35265 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753866AbcIOD2L (ORCPT ); Wed, 14 Sep 2016 23:28:11 -0400 Received: by mail-pf0-f193.google.com with SMTP id z84so1608468pfi.2 for ; Wed, 14 Sep 2016 20:28:11 -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:mime-version :content-transfer-encoding; bh=zlSv3WwmtAwk6wjn0UE/euAeFWLlqr6iRvrnUdhz61I=; b=fr8TESe6Haq1bGxgLRPGbVXss69c/5GCQlWwSuB+Meg2UVtkc7r8JxlkIg9PTXpdqE q/lSh0eWvbMJnBn1ZfYWjcs6FKlWLUuxx2c5pS9PIViekNf/JKHN+mJsAwEkQHIjoMpa UC+GLIs1Mishy+Flg4+banwv8FuMwG96/8w7+aKp0SbDkAzMtQIltFj8fp8HHByoKcUg jFn1AMXqaXvpLf3goLYlGfSm4X+ssW7b/nXwBAsYQXTygyC8a4gZm1/pEGidr8u8lKtF bMvINreCxTafM/M6y4DB3D924/WTH7jfTSsu4kDFJVvg9TLfaYZrzM93wpHxL+PVhdrY KVxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zlSv3WwmtAwk6wjn0UE/euAeFWLlqr6iRvrnUdhz61I=; b=PDI/Gx2e1bfB5WMzq/H1zXj1x++k3Kig/yBLeBZMtE3B0v0RSWxO3kZDZnmK8si6bw zWu9D95XelxYZDGakHARxyFASTCvR61CQBWZIstc+YcFWi1R6loYh/ubMDR45wOqYJDD AKYWHQamrR4HmfzIJpGKFIVW0YEduRU6uwqOy7vMQVdHzOrJ96qSX9tL3XjtXYgrkCxk XivPsqhH/a825jX0YVigjzSzXMlJLGullpLVxZxDi9RadCSC/pwOg5ozLkbEUpNJvRJi 4LJ626FisfVMjArrT2VLDk/CIHpN6yKQW5shh9r9v+ufhR+her/VS2Bje+BVXVa7wgSs fH1Q== X-Gm-Message-State: AE9vXwOPzBdVz/WnjVOa0MoZ/7+Z1/3tVI8oStGmrENkxXSAkD5VaG/SYqHoAQhRGvmqoA== X-Received: by 10.98.5.133 with SMTP id 127mr10821543pff.40.1473910090693; Wed, 14 Sep 2016 20:28:10 -0700 (PDT) Received: from localhost.localdomain.localdomain (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id 81sm40994398pfm.90.2016.09.14.20.28.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Sep 2016 20:28:10 -0700 (PDT) From: Wei Yongjun To: Tom Lendacky , Gary Hook , Herbert Xu Cc: Wei Yongjun , linux-crypto@vger.kernel.org Subject: [PATCH -next] crypto: ccp - use kmem_cache_zalloc instead of kmem_cache_alloc/memset Date: Thu, 15 Sep 2016 03:28:04 +0000 Message-Id: <1473910084-31739-1-git-send-email-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun Using kmem_cache_zalloc() instead of kmem_cache_alloc() and memset(). Signed-off-by: Wei Yongjun Acked-by: Gary R Hook --- drivers/crypto/ccp/ccp-dmaengine.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/crypto/ccp/ccp-dmaengine.c b/drivers/crypto/ccp/ccp-dmaengine.c index ded26f4..2e5a05c 100644 --- a/drivers/crypto/ccp/ccp-dmaengine.c +++ b/drivers/crypto/ccp/ccp-dmaengine.c @@ -299,12 +299,10 @@ static struct ccp_dma_desc *ccp_alloc_dma_desc(struct ccp_dma_chan *chan, { struct ccp_dma_desc *desc; - desc = kmem_cache_alloc(chan->ccp->dma_desc_cache, GFP_NOWAIT); + desc = kmem_cache_zalloc(chan->ccp->dma_desc_cache, GFP_NOWAIT); if (!desc) return NULL; - memset(desc, 0, sizeof(*desc)); - dma_async_tx_descriptor_init(&desc->tx_desc, &chan->dma_chan); desc->tx_desc.flags = flags; desc->tx_desc.tx_submit = ccp_tx_submit;