From patchwork Fri Oct 24 15:01:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 5148251 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C904C9F349 for ; Fri, 24 Oct 2014 15:04:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 116932024F for ; Fri, 24 Oct 2014 15:04:35 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 724AB2018E for ; Fri, 24 Oct 2014 15:04:33 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 7BEAE26050A; Fri, 24 Oct 2014 17:04:32 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 081C6260518; Fri, 24 Oct 2014 17:03:22 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 0DD642604A7; Fri, 24 Oct 2014 17:03:20 +0200 (CEST) Received: from mail-yh0-f45.google.com (mail-yh0-f45.google.com [209.85.213.45]) by alsa0.perex.cz (Postfix) with ESMTP id 13A022604AF for ; Fri, 24 Oct 2014 17:03:10 +0200 (CEST) Received: by mail-yh0-f45.google.com with SMTP id f73so861757yha.32 for ; Fri, 24 Oct 2014 08:03:09 -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=FBmYEmIr9EADG9/HqzNcGEbg+9QslhZOx9L7TpXW37s=; b=0G4BzfT0i3IFNgp/Evdymx5U5bz2bBwSGDNGVB6WpK9qIYy7CX2pQ6eEFe9iyPlAnv J2mZV+nhq3/VyeTbkNrKChoAME/HRVqISi98D3nw38T6ytlxQAwohAHi/eclCLOePjFv /OsQ8SbH++7gZ363htM99gv/P+j8vWdLvl5HL53kX6RjeIV5XNd9HvvypOuK1Nh/HkP8 UUnKzcWcmwO0698G+89HeYqbLVzQBO8ksj7HrVwmmITxR77duyGj8n8EPkZVmqjvO/Y1 8lTvgxE1Y8hS+asTRu/46MdSSSozrL0WiYZlW0VT4UFZ1AZkx+uYekArrxV4tdTAt9Dk y5kg== X-Received: by 10.236.96.197 with SMTP id r45mr5773627yhf.52.1414162988934; Fri, 24 Oct 2014 08:03:08 -0700 (PDT) Received: from localhost.localdomain ([201.82.52.106]) by mx.google.com with ESMTPSA id m9sm2171084yhm.24.2014.10.24.08.03.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Oct 2014 08:03:08 -0700 (PDT) From: Fabio Estevam To: broonie@kernel.org Date: Fri, 24 Oct 2014 13:01:26 -0200 Message-Id: <1414162887-14279-2-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1414162887-14279-1-git-send-email-festevam@gmail.com> References: <1414162887-14279-1-git-send-email-festevam@gmail.com> Cc: Fabio Estevam , alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 2/3] ASoC: wm8962: Use the preferred form for passing a size of a struct X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Fabio Estevam According to Documentation/CodingStyle - Chapter 14: "The preferred form for passing a size of a struct is the following: p = kmalloc(sizeof(*p), ...); The alternative form where struct name is spelled out hurts readability and introduces an opportunity for a bug when the pointer variable type is changed but the corresponding sizeof that is passed to a memory allocator is not." So do it as recommeded. Signed-off-by: Fabio Estevam --- sound/soc/codecs/wm8962.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index 9077411..cfd3891 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c @@ -3552,8 +3552,7 @@ static int wm8962_i2c_probe(struct i2c_client *i2c, unsigned int reg; int ret, i, irq_pol, trigger; - wm8962 = devm_kzalloc(&i2c->dev, sizeof(struct wm8962_priv), - GFP_KERNEL); + wm8962 = devm_kzalloc(&i2c->dev, sizeof(*wm8962), GFP_KERNEL); if (wm8962 == NULL) return -ENOMEM;