Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752916AbeAEUal (ORCPT + 1 other); Fri, 5 Jan 2018 15:30:41 -0500 Received: from mout.web.de ([212.227.17.11]:57369 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752826AbeAEUah (ORCPT ); Fri, 5 Jan 2018 15:30:37 -0500 Subject: [PATCH 2/3] mtd/nand/ams-delta: Improve a size determination in ams_delta_init() From: SF Markus Elfring To: linux-mtd@lists.infradead.org, Boris Brezillon , Brian Norris , Cyrille Pitchen , David Woodhouse , Marek Vasut , Richard Weinberger Cc: LKML , kernel-janitors@vger.kernel.org References: <8f678424-3ce1-3a4c-1b0d-f3ac9a226f00@users.sourceforge.net> Message-ID: <4df8f355-b072-f0a6-1314-354a6bafe772@users.sourceforge.net> Date: Fri, 5 Jan 2018 21:30:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <8f678424-3ce1-3a4c-1b0d-f3ac9a226f00@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:+fXccgoq3VizeaB/D7G1JLMO8rqfksImeMrDx7PiNxtESAI7I9P l7Ku1PDMEvMC5apDB2xzDcOVKhMZePwX7cfREAv5Ww7FluZHbVtIdX5slkw1bj7PkaQ3f7o SweitsH9H+R371H0ruIqgBtDw3mW/FEW7pzz16WX3OqXqXUQWez4cD0I72WkCIDO1EdEo87 3biZqnwGEkces43HW9QUA== X-UI-Out-Filterresults: notjunk:1;V01:K0:ditn5tld304=:7tGgcFR7UNGN+/ZxZoZN48 wscQ3gAD2tEPtphwI2URQKvqkouLEI7a1bcUe7afSCFsIwPY9uMUO9b3bLhmTopAigAIyzvqf A3VbkbEy2/xTchQNHXXXcz3/EsbdYiwVERlTKzSvCxxdeMdP0B5oHS7zuSB/ZpIY6QYHQi2Fz S7MexywAiTNcVDGIlQnNry6pZamteIo3noiekW6chbLZi8EhBFDuGEB97SZHURZg20v77qnCt 4HSorihd/S3/q8C1WOmcknTICwJN1YvDURSCZGKV6n82LVzbK/BQZzxgxvYMzOawfV1ivqL3N 6bnHeBHV3imirM6cFGA5Y4hATkAEuULsKE3DLCicqQRQtzAf4Dw3D5syVsBad6o0+o5DiuCBi PloM1FK/1VUrJHhqusVsSw5zWsqcWNzKuMw7Wm0GkgDsjI6l9TQZYgVGRRobh4tsQFSHah7EJ 22TBdD6LeT8oo3zBpXahrIfb0BsJ4yT3XgUSj7At4Qa8pOYcbSWhSpTU5iv4uErUUNQ8mx3UT Zlqn63VEnG+woARutK+pGnAyOptJ9l48ylmzlqc2DRtOHa1SB7ZblaNudk8pWarw8V4qH9MiY 2/6l5mFYUlmq9AemVoJgzawtxrSShft3q5yzXi+EZa04xwnTOlovtSsRDmYBC4ZbAs24iygkk 3L1ewbuZef0bgQiJ2f3k7M7e0/V8N4XfwPnFHhTb8K9sOo/dfZxxj73MDF/gOVm6wd8e3/JV+ QDf6U8rx774Ds7Sl/Vp20uT46g5oGu7oplNO+XQzhfF4hS0DHaQl1mDmKCpPdNVgx9GHGIxwY JXC7tLU1qWOPJpZLDv2Or0h65zY43gjvQonB66igAeil5mHP8I= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Markus Elfring Date: Fri, 5 Jan 2018 21:03:20 +0100 Replace the specification of a data structure by a pointer dereference 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/mtd/nand/ams-delta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/ams-delta.c b/drivers/mtd/nand/ams-delta.c index effaecff0f2e..4f5fc104c510 100644 --- a/drivers/mtd/nand/ams-delta.c +++ b/drivers/mtd/nand/ams-delta.c @@ -183,7 +183,7 @@ static int ams_delta_init(struct platform_device *pdev) return -ENXIO; /* Allocate memory for MTD device structure and private data */ - this = kzalloc(sizeof(struct nand_chip), GFP_KERNEL); + this = kzalloc(sizeof(*this), GFP_KERNEL); if (!this) { err = -ENOMEM; goto out; -- 2.15.1