Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752758AbeADKxJ (ORCPT + 1 other); Thu, 4 Jan 2018 05:53:09 -0500 Received: from mout.web.de ([212.227.17.12]:50018 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752159AbeADKxH (ORCPT ); Thu, 4 Jan 2018 05:53:07 -0500 Subject: [PATCH 2/2] mtd/maps/sun_uflash: Improve a size determination in uflash_devinit() From: SF Markus Elfring To: linux-mtd@lists.infradead.org, Boris Brezillon , Brian Norris , Cyrille Pitchen , David Woodhouse , Marek Vasut , Richard Weinberger , Rob Herring Cc: LKML , kernel-janitors@vger.kernel.org References: <30c07f5a-578c-0e53-b80f-675fb24e6223@users.sourceforge.net> Message-ID: <1c70e16b-f34c-d655-fdd4-67730f17a680@users.sourceforge.net> Date: Thu, 4 Jan 2018 11:52:27 +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: <30c07f5a-578c-0e53-b80f-675fb24e6223@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:cRJLLQTf26lQwrZ/jb9y1sLsAYjojdyNI3dqQgTfBU4WIHsdlI0 xxT0yuBUXSt3afV8lCKCWC/sQ4V0NwwNA6qiNOpgEPycOOsObFUaGr/y3al+o1Zii6SBGVR td+FiIMa+zqL2YN/HjS0sci9I4+PJOJKd83wAcEiFq8xqUql2PwTn7UFnsVxjfMbvIj7H1I Yid4hcqwFo/xA5UImlhzA== X-UI-Out-Filterresults: notjunk:1;V01:K0:6ACPkgTiwaU=:liLrCGY1KEGNezlw/NRg4E CnSvrpFwCm8NRtdO9Y0p/gV1W4pxGz9XWwQNgA86WBbrdyMgQ5F+BYnhhKDmiey1Vwcnzh+9U ygA6s4OQagNLo1vS0KIE5FEM0suNKOVGz5nMbj6ArUHVAVKErhopn97QGau5rfxWbgtiifd4i NfJ2PhA5y/+3se9sAJ7plJWOcOHWxGPOlSc43g9mzLW4kG6wNQ3Z7Gc/bGkdf0vH18QoVKKO+ NiUezGxZbtBWWOhdBoPJ7/l5iQa1W0qiBFTYcB96IzDUHpbubqQxlCcTO1DYAfJsiwQKIk83n BqfsKQJIpwkF1+lA9jZtQ16Ji9UOUWolSkU7XHjOBfXTIwXc+E8fhbi3Dhhcgf8k6zjPsIfUC y65aedPaRJhxUorP1PDX7ahz7VOqqYg14htFyCxFovMb1SXqceF6fYjp/zvyel15+MbCEiu7X axC11m7lVsPbr4jbLv8svIIb8v/6/lqMk0bc/DUK+FO7IurbanZdBu3+iXxFpIBTYlDsrGLXQ MqvBBqoiRtKgqIybGJGMsSe+2Ag12YeLSvPwyFClSqxyNYB6zJ7StNeFVgU5coeIRtX3x2+wp TcolyFYAuZqNLvmmoP9mLRb4JYhge03ekT8wAt4Ehh/BZGN9aghY1kquE+IAf6q6cnMFi4QZg Hvdp7/YnpvwlkLvS96oEB9xsG+J46LfBS471ISQgtCXqsJsfyH9HWNf20p5mR4WO6Nmo2mopa NVYWegEAxIeu27UR3tqjWay9Wsc6kIVnrB3SMbKpsU3Bw7DFBDkw0lFy1I+SLtvrqNjKdV3HL CrnVhd8aIot8AzLwkMtxDO1OolG3XCfRHEZVB2YKNTeMAFyhG0= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Markus Elfring Date: Thu, 4 Jan 2018 11:38:28 +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/maps/sun_uflash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/maps/sun_uflash.c b/drivers/mtd/maps/sun_uflash.c index 80a253cc72e2..16a4f16a2680 100644 --- a/drivers/mtd/maps/sun_uflash.c +++ b/drivers/mtd/maps/sun_uflash.c @@ -61,7 +61,7 @@ int uflash_devinit(struct platform_device *op, struct device_node *dp) return -ENODEV; } - up = kzalloc(sizeof(struct uflash_dev), GFP_KERNEL); + up = kzalloc(sizeof(*up), GFP_KERNEL); if (!up) return -ENOMEM; -- 2.15.1