From patchwork Wed Aug 7 15:40:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 11082377 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-2.web.codeaurora.org (Postfix) with ESMTP id 0EDB714F6 for ; Wed, 7 Aug 2019 15:51:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3AB828791 for ; Wed, 7 Aug 2019 15:51:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E7BB628A58; Wed, 7 Aug 2019 15:51:42 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 4E90028791 for ; Wed, 7 Aug 2019 15:51:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388810AbfHGPvg (ORCPT ); Wed, 7 Aug 2019 11:51:36 -0400 Received: from smtp12.smtpout.orange.fr ([80.12.242.134]:46383 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388758AbfHGPvg (ORCPT ); Wed, 7 Aug 2019 11:51:36 -0400 Received: from localhost.localdomain ([86.218.179.140]) by mwinf5d35 with ME id mFrR20003328hQe03FrRek; Wed, 07 Aug 2019 17:51:33 +0200 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Wed, 07 Aug 2019 17:51:33 +0200 X-ME-IP: 86.218.179.140 From: Christophe JAILLET To: atul.gupta@chelsio.com, herbert@gondor.apana.org.au, zhongjiang@huawei.com, ganeshgr@chelsio.com, davem@davemloft.net, tglx@linutronix.de, bigeasy@linutronix.de Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] crypto: chtls - use 'skb_put_zero()' instead of re-implementing it Date: Wed, 7 Aug 2019 17:40:14 +0200 Message-Id: <20190807154014.22548-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.20.1 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 'skb_put()+memset()' is equivalent to 'skb_put_zero()' Use the latter because it is less verbose and it hides the internals of the sk_buff structure. Signed-off-by: Christophe JAILLET --- drivers/crypto/chelsio/chtls/chtls_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/crypto/chelsio/chtls/chtls_main.c b/drivers/crypto/chelsio/chtls/chtls_main.c index 635bb4b447fb..830b238da77e 100644 --- a/drivers/crypto/chelsio/chtls/chtls_main.c +++ b/drivers/crypto/chelsio/chtls/chtls_main.c @@ -218,9 +218,8 @@ static int chtls_get_skb(struct chtls_dev *cdev) if (!cdev->askb) return -ENOMEM; - skb_put(cdev->askb, sizeof(struct tcphdr)); + skb_put_zero(cdev->askb, sizeof(struct tcphdr)); skb_reset_transport_header(cdev->askb); - memset(cdev->askb->data, 0, cdev->askb->len); return 0; }