Received: by 10.223.185.116 with SMTP id b49csp819843wrg; Wed, 14 Feb 2018 07:28:42 -0800 (PST) X-Google-Smtp-Source: AH8x225pN0uW2cRh5pfyR+Kf2ivzI1TCzhEZVdUQbTYYYVQf4fN4n7QKCrCU5MkYhB7cn7eG+TO2 X-Received: by 2002:a17:902:7793:: with SMTP id o19-v6mr4829534pll.207.1518622122610; Wed, 14 Feb 2018 07:28:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518622122; cv=none; d=google.com; s=arc-20160816; b=OxIRErwBK2RoaD2pnTZZGlxmm8z1zNJ8BVIAIRpjDTbqvEcGJVihRsHHrgQYQ1eUXZ nymbFZGnuS042Z0K4z2yPduOtN0cd8hx/xV/hB7Dt2vCv97QJ7aRwLVzx/WjGm5rDxks /5CltRmlfXZ4gn3Ff6FaXr3VYibFtd5uz3jSQ5vJKS3vsU4OnbDeA+7W7NluqgYNqUCT xHbMqU8+E3+GQtMqmWHqBskTxhOpNxXxI84Fg26CmlWgwIgqLrPFBTd6i36dR6QV/78k U+15ouPYvYozFFltil1t9eenWdck6C17VGHwHBnAgIWvnlE9WDpaw0VprWOR84IVX5EL 3wzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:arc-authentication-results; bh=mnXezG/SI78Hk0OwOaJ7xZqfPRk2osmoaJ8iYkRzUww=; b=Eus5QesiRJ5bJ1ksQYq3bNfvQ1rtoknMqtm2JlOJD+ryJzOgCsAScNVy8cseiIkqdc lh/JTjC18N4KutG7HmGT05Fo2lODuDbI3oTikcq7x3nIX13rBLxd4gajGsB2cG8c08gH 2x66R9O441btiI718a06jct+ygNrxyh4kPy4wY3Rr+Fo9iGYsS26cgr/U+ai+OzL4TaD Lex22Ofcv1/WEjudNbG9S/+hI0ivsdfoMw0IzkS2sCDvIvZimfnVj7y6CFSwASh3Xbw4 bLk2j8AP/sixBNGRQWXs+CfIObGi2fKsmWirWidvaCs/nn29Blga5OYLpNvFx8oOY0Om v51A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n78si1641432pfj.337.2018.02.14.07.28.27; Wed, 14 Feb 2018 07:28:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031289AbeBNP0u (ORCPT + 99 others); Wed, 14 Feb 2018 10:26:50 -0500 Received: from mout.web.de ([212.227.15.4]:36201 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031243AbeBNP0s (ORCPT ); Wed, 14 Feb 2018 10:26:48 -0500 Received: from [192.168.1.2] ([78.48.82.239]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MVLoc-1fINw811Qs-00YjcW; Wed, 14 Feb 2018 16:26:38 +0100 Subject: [PATCH 2/2] crypto: omap: Improve a size determination in three functions From: SF Markus Elfring To: linux-crypto@vger.kernel.org, "David S. Miller" , Herbert Xu , Joel Fernandes Cc: LKML , kernel-janitors@vger.kernel.org References: <28780631-d093-a581-8690-3868f8fa327e@users.sourceforge.net> Message-ID: <0a45e47f-5ed0-5dd6-7545-adc8df2d7972@users.sourceforge.net> Date: Wed, 14 Feb 2018 16:26:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <28780631-d093-a581-8690-3868f8fa327e@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:F6IdtW2R36jTuBtu2ArWP9UyF4b6nhPHcKjK/x09ZotpVyIrvNl GoGIPhnWMZgp0vc/mCjB5Oaslkf/WGEVVglsSxqeRL7jqMleR9TNiR6EtHfR2rVwPJCKNmy opvGklAxB7/J3xU78E4++E47H4xJTlnEqTG8R14ohXshp/IVJdYF3dVpA/FI6KQf90D1A9k 10g2w5l7ryJ/44SE8XHTg== X-UI-Out-Filterresults: notjunk:1;V01:K0:PM+TLYRmcdk=:kuwfI7IqTiTco/Rx0eow+f qtnCxODHn3vZjldJoqj7zC2L3nCW7xInIJqy1IHzc80UHzTADWJ9FRMsWnJ0s3+gDim6dHJZU /AcQKX3wHvi1qHi45UCfgF87QAkNIwwoVpFWqTh7f00RXpoOgAvjvdT0HYm6O8BdI32I9Lcls qcgaObBI8FoiHDCIFHaDo8jYfx0/VeBEEd+fFtPnMD8AdkHkoO2oVSuwWBHrM790VTVzolram gjtXrVMPpT8f7Ix6rQCzLthYqQ3v8obLACdtlQ0mbgNrl+iEZPzzy/lcu0q2ZJwJSrmc8mzTY yEsIn40bRmrgfyDgjtPxAWbNIyH8SNjKlo0ARKrPuCdNz1VfPfzf8o6REVdOTOG7HnhNQRidR dgRQNQkwXWV4zziqTXVFRiKmYh8SvvnxHCk5P7ZsDY1O76L4iOR/kx0dcEkxy+WthTOPXGODO SwKT1XdwEM0sb0JpjDZhLIvVJdq6sjkwbJvmSZfrus45WIhfuYR13gEqMlE0X0OfguZbF61sC hriuWUKgkotEERQED7s78sXi5M4g9tOQ7BDDR1ph63utz60rP2RPWVV5XWIu8debiwqQx0oID LwXUTPGkF/QOHASoy3jYrIGd5Q3cMbyKzZVJbW0mFTwjVDuPWLVK1ToMWZY85zC5lh9d0mKi8 wAKvTSanH1ESXddxd28Wz7WtaSWX8eYdmo6F9DPsBQ6XHOS3+RD9QRTU1kx9Ez50eLvQTYc+j nyeqred9oEhX9ENHKnL1OIwNVEc9O5E/Dm2xcrwgZIdktGRAiyFshcrkBgdN1ozUwQrPfnqUN d4I1m6eA+LMQzAZwkrDYFjP8q5Q6VEhvtlp8bL6ShZVFM8em5g= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Markus Elfring Date: Wed, 14 Feb 2018 16:12:05 +0100 Replace the specification of data structures by pointer dereferences as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/crypto/omap-aes.c | 3 +-- drivers/crypto/omap-des.c | 3 +-- drivers/crypto/omap-sham.c | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c index a2bac3b869b6..82282a5e9b3f 100644 --- a/drivers/crypto/omap-aes.c +++ b/drivers/crypto/omap-aes.c @@ -1032,14 +1032,13 @@ static int omap_aes_get_res_pdev(struct omap_aes_dev *dd, static int omap_aes_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct omap_aes_dev *dd; struct crypto_alg *algp; struct aead_alg *aalg; struct resource res; int err = -ENOMEM, i, j, irq = -1; u32 reg; + struct omap_aes_dev *dd = devm_kzalloc(dev, sizeof(*dd), GFP_KERNEL); - dd = devm_kzalloc(dev, sizeof(struct omap_aes_dev), GFP_KERNEL); if (!dd) goto err_data; diff --git a/drivers/crypto/omap-des.c b/drivers/crypto/omap-des.c index f4199be783a9..09833709fbed 100644 --- a/drivers/crypto/omap-des.c +++ b/drivers/crypto/omap-des.c @@ -957,13 +957,12 @@ static int omap_des_get_pdev(struct omap_des_dev *dd, static int omap_des_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct omap_des_dev *dd; struct crypto_alg *algp; struct resource *res; int err = -ENOMEM, i, j, irq = -1; u32 reg; + struct omap_des_dev *dd = devm_kzalloc(dev, sizeof(*dd), GFP_KERNEL); - dd = devm_kzalloc(dev, sizeof(struct omap_des_dev), GFP_KERNEL); if (!dd) goto err_data; diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c index 7aa4eb50ebc9..ffa3ac3bde55 100644 --- a/drivers/crypto/omap-sham.c +++ b/drivers/crypto/omap-sham.c @@ -2015,14 +2015,13 @@ static int omap_sham_get_res_pdev(struct omap_sham_dev *dd, static int omap_sham_probe(struct platform_device *pdev) { - struct omap_sham_dev *dd; struct device *dev = &pdev->dev; struct resource res; dma_cap_mask_t mask; int err, i, j; u32 rev; + struct omap_sham_dev *dd = devm_kzalloc(dev, sizeof(*dd), GFP_KERNEL); - dd = devm_kzalloc(dev, sizeof(struct omap_sham_dev), GFP_KERNEL); if (dd == NULL) { err = -ENOMEM; goto data_err; -- 2.16.1