Received: by 10.223.185.116 with SMTP id b49csp1933424wrg; Thu, 22 Feb 2018 05:39:45 -0800 (PST) X-Google-Smtp-Source: AH8x227/qvcdxDwd7asM4DLQaCxp7qtZHjx4MJTA/APab7VwMNzuV86/ZKLV8uETfF18KFunA74F X-Received: by 2002:a17:902:6c4f:: with SMTP id h15-v6mr6619068pln.435.1519306785883; Thu, 22 Feb 2018 05:39:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519306785; cv=none; d=google.com; s=arc-20160816; b=CBG0ypAhUR4wagVwR6rcGOg/bN6YYxBi1xNrv+fMUoc2lyYlT4hXrYJ6ucH8pgwLW3 bkh6RQz9iF/uX7soKRztMgnKhki/a2YgX6oXwsMgDBD7cVB57rSUc4FQ6pdEdiRBnVpL MCtvdmdFcdgkMOiTit7EVHMS7Gzhxr8fszyp4NNJmMR3GAmK9Q3ypN9Z4XZvKkA0Pmv7 8v2Z9p5QtE0SQ12xb+10s0aAclavgbXtI25YcT7R0nfzeA4moy8FBoVGIMKJZKcz4E3u wALB4w240JK9frln9PUJ2bQPjE3ScL2694i4zAdMQQWyeisCEumTUGN3v+zC/dTzLzjE BA9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=7LMDyRAvnkmrAhRg9+D37wNHAMsMoX/iGQ+WWopI0vQ=; b=PdCniX14bYnFGqWLM2LsYVZRHvS6lsHzhP7Bj5ETy3FV/zRVhamqsh5D9gqCCt39G8 nZotZLRcU9H+EMQ/RopNGbdu4MSNsmC0LRolGa/gwWeAKtwEGAKQ0CnjgHSRtjPiusJP TPUUkVaW7mT0Tb5pQp0m/SzUqZ4OTYp2RJizG0RuWxCJs9MWnCCHHpq0jhWVFBagv+o5 bJ+YZbDygSGA9RS9lIEyKdpiJfsxk6BHp6rDaBs8o0l71LP4GNZt0bpCJMGSWRd7+VjF uDaoDYvAN1urDu5AXDJSs+dF5ZAHf0Ec11AdGlD4cIeEFvGRiBvioZrRYbtJMWZGV9Z6 AmWQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e124si39211pfe.170.2018.02.22.05.39.30; Thu, 22 Feb 2018 05:39:45 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932637AbeBVNi1 (ORCPT + 99 others); Thu, 22 Feb 2018 08:38:27 -0500 Received: from orcrist.hmeau.com ([104.223.48.154]:56800 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932491AbeBVNiZ (ORCPT ); Thu, 22 Feb 2018 08:38:25 -0500 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtp (Exim 4.84_2 #2 (Debian)) id 1eor4l-0006ru-GI; Thu, 22 Feb 2018 21:38:19 +0800 Received: from herbert by gondobar with local (Exim 4.84_2) (envelope-from ) id 1eor4f-0007Zp-QA; Thu, 22 Feb 2018 21:38:13 +0800 Date: Thu, 22 Feb 2018 21:38:13 +0800 From: Herbert Xu To: SF Markus Elfring Cc: linux-crypto@vger.kernel.org, "David S. Miller" , Joel Fernandes , LKML , kernel-janitors@vger.kernel.org Subject: Re: [PATCH 2/2] crypto: omap: Improve a size determination in three functions Message-ID: <20180222133813.GB28447@gondor.apana.org.au> References: <28780631-d093-a581-8690-3868f8fa327e@users.sourceforge.net> <0a45e47f-5ed0-5dd6-7545-adc8df2d7972@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0a45e47f-5ed0-5dd6-7545-adc8df2d7972@users.sourceforge.net> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 14, 2018 at 04:26:36PM +0100, SF Markus Elfring wrote: > 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); I'm fine with sizeof(*dd) but please don't combine the allocation with the declaration. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt