From patchwork Wed Dec 20 09:52:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 10125361 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 66EB96019C for ; Wed, 20 Dec 2017 09:52:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7736129671 for ; Wed, 20 Dec 2017 09:52:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6BF04296E7; Wed, 20 Dec 2017 09:52:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F1C0029671 for ; Wed, 20 Dec 2017 09:52:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:References:To:From:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bPcCix14/LMkLnGgucCZ/TicJhtGaEjQ5WrpUxb5I2o=; b=IUZkFF9eVGlr1b MUalUnul16WppJy4smH+nhMc01UJD5D1tg0tml8v8TFHRQoih3geALlZrZXybwVHQBMaFmQ5Rb4xX ohIbG4fMu+E9hM/ouAn2h268yN3CstuJ51f0aCruQKs9CuOnWhCMYNRqCLTXzP9KlStdLb6aYM2aD n35uOGu26GhETRJdXe+S4lwcWQPSl13/5DwOewos/2e8dZ+HRSSbkj00xiaUQ7n4KvEXN0QmxkkJo +Wcusf6fQqibFyQLhf0vRL82BUmGemCTt5kiGCaQd7LRH3r0ltDuLgClKXInKKN/hMSBK6hvkXoyh YwOsi4P3wQgWR4Mi10Mg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eRb3W-0006cZ-EP; Wed, 20 Dec 2017 09:52:54 +0000 Received: from mout.web.de ([212.227.17.12]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eRb3Q-0006a5-8Q for linux-arm-kernel@lists.infradead.org; Wed, 20 Dec 2017 09:52:51 +0000 Received: from [192.168.1.3] ([77.182.233.7]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0M1o86-1fFr5c47eU-00tlWO; Wed, 20 Dec 2017 10:52:35 +0100 Subject: [PATCH 2/2] pinctrl/nomadik/abx500: Improve a size determination in abx500_gpio_probe() From: SF Markus Elfring To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Alessandro Rubini , Linus Walleij References: Message-ID: <93beb4d9-99e2-e7f2-e752-2d7228a8df46@users.sourceforge.net> Date: Wed, 20 Dec 2017 10:52:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-Provags-ID: V03:K0:UIdeicdexvfizSyaIIDfEd4zuMyX5WwdMNTSfhliDF7jmSbV0o4 /EW7xXjkt0oY8er7x9kUdJf5F8ecXmkI0tHAjJ2eMu1a4aV1ypTxB41J1gm32pPfqZVvpnV g+aEa9fr3H50YkRodGazBz7AQUMv/ZibrqTT/9JMO33SjxqUcBTnyYYr8FcYcik7R5lxJp8 ytvVIUW94F5KC02b4UyJA== X-UI-Out-Filterresults: notjunk:1; V01:K0:v+mYTdEk/LY=:2Ws1xQ7u2nQ0qCYiUoqu7s ShuF80/qPgg0jAcVnpDVpWU1q6gEiOSJ97BcVi719lk+oFtPKwU4GMQ8ZMyN+1WK8uv5j6iiF SdFlW6QSKr/EInewRULaucRBHAjiqmtqKwULElDur121YHaWPHyrHmJq/YETWTeCG5646GtgR IXjQDQ8T3F9oQzOb6dM1S37347JMQjw1VCb3BAFfHABxGgPWwTF01Du97FcJSvx8j2D5gbeRC 7+tpwCMBQo4vc716gdhMcd2M6+Ed1G342rZC2HmxkFTjUXcN0G5u6MGGr97xIqiy9Xy4NxAuy A2UXN3nO3DyEkHKC3IO3I6Idl3PRQo0mdLmnU6yErD/xgr2841OQvpag6aXJ80NkEb9paRa9L No2CrxupLEuAIiX52U8ltHNEaB6sxDGWQ8bwllH7nancFcdHMg1uepcFrE9M/i0y+kRW6MPit kcPxXsqF44nK+2yMJAPl+Hc8vfXSPBaH+VjxV2vAn4STjcODyWMT05iFCxONow37VXlyryYK+ bihY3j9TsyQsnipS8hfOaBKx5dP4vH3qG+etpM0hPFvUoMzzy0tJtefOeKWgB40LT8uBZ70Rr WwH5ZFeLoY0zfBO/ohubEAv0EyFad4yoae0xPUWBw8FrxUA6oDWI5CnqanG4qGCuPXgAOOgem pi9OvHQh2cHEkaQfAc4zin76g0cCRMlBym2XJJ3g0si0LCMBO9bSF5BSReaH4xyfxN6Pf4NsB POOX2QNafvPG70PmqtuWa46l5Bw6wPnnvpJZChv51mCW3RjJbvnNtGLESngJwdxy3Hz5F2X27 8QI63f5xBpzKXIdjjxQ5g/VC8GQlcnFNpggi/AWGfcmNV2oKXk= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171220_015248_724024_635A8FC9 X-CRM114-Status: UNSURE ( 9.15 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, LKML Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Wed, 20 Dec 2017 10:22:53 +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/pinctrl/nomadik/pinctrl-abx500.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/pinctrl/nomadik/pinctrl-abx500.c b/drivers/pinctrl/nomadik/pinctrl-abx500.c index feb030d1ea63..7d00a5d864f5 100644 --- a/drivers/pinctrl/nomadik/pinctrl-abx500.c +++ b/drivers/pinctrl/nomadik/pinctrl-abx500.c @@ -1155,8 +1155,7 @@ static int abx500_gpio_probe(struct platform_device *pdev) return -ENODEV; } - pct = devm_kzalloc(&pdev->dev, sizeof(struct abx500_pinctrl), - GFP_KERNEL); + pct = devm_kzalloc(&pdev->dev, sizeof(*pct), GFP_KERNEL); if (!pct) return -ENOMEM;