From patchwork Tue Sep 26 16:22:44 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: 9972305 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 5FAAF60393 for ; Tue, 26 Sep 2017 16:22:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 514C928E7F for ; Tue, 26 Sep 2017 16:22:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4610C28E9C; Tue, 26 Sep 2017 16:22:52 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D98CE28E8F for ; Tue, 26 Sep 2017 16:22:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967665AbdIZQWv (ORCPT ); Tue, 26 Sep 2017 12:22:51 -0400 Received: from mout.web.de ([212.227.17.11]:63996 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967286AbdIZQWu (ORCPT ); Tue, 26 Sep 2017 12:22:50 -0400 Received: from [192.168.1.3] ([78.49.148.35]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LoYjO-1dPRQF0y2k-00gc1A; Tue, 26 Sep 2017 18:22:45 +0200 Subject: [PATCH 2/2] clk-mux: Improve a size determination in clk_hw_register_mux_table() From: SF Markus Elfring To: linux-clk@vger.kernel.org, Michael Turquette , Stephen Boyd Cc: LKML , kernel-janitors@vger.kernel.org References: <0d223969-36c3-6f78-97cb-46c074207d2f@users.sourceforge.net> Message-ID: <7d70d3de-ba3b-3619-05a8-9a4abe0dacfe@users.sourceforge.net> Date: Tue, 26 Sep 2017 18:22:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <0d223969-36c3-6f78-97cb-46c074207d2f@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:BzpNNzjD6UQRM/Jb/HaEcsfV5ajGkpcfPmS2zKz+UxCQ2kctg7f kObN5kH0+BmBt97bpvTCoRjBPK4b5g/ofVAKYqbkMKwkJbK13Kjji9AU9NrvVKUUDVH7nf/ WdSfJxI5Xhkq3T2t5/+VzAEuGvNvYmafa/XLFoZm8QgETHQQc5KFKHPNSq2JlMW5z2+2WTw PIUJt88fH6HO5HdItqWHg== X-UI-Out-Filterresults: notjunk:1; V01:K0:/BvEdohb8dY=:nYZniX8uRV5w4Y9zaJG/Kc 2y6Pni/SAyv2c9UqmSJrQ4DY2/1nKUUHvg3MAUPjlk79TmDZTec8+jZe+liqNNvmijPqPatEh qDlkBwqHqbjaXFK+i5slUQxdM9AP71TtmuXbOvG5N36h/GR174ODOvSraETUS7uILyxyHWmGa IDFPZQ9yqujRez4HkrTCwuGZ0Miaa6SGwoJy98pJhOWFExIXGqGjtoDRWAiPZVafzGXjEMfMD R9Q5WfTbqRwcxMdUaoXQsAVrwWWmBPN66+keha6XiGt8Kc+NFiwaUbEchShOjrhMQ1HWzAKsA MQWcSrZ+k/FD+rtCAbE1m15hYOfR4Rw02KR8SNUHdtaZLF2JB1Cn/tli2CxrD8ChLZATLXQg6 9Av1SaqGg1uSt1b6KpT4irnMju6p6lP2pBTvio5EWYyjrt7rA/HZLSYLn0nMR9w1eyQ03SYQj Nds2GMKBcrNuhdbjEFWu8fBZBn1ctMHEFGeBulPk7xZEaZKoHrkXXbw5OHOFSCowjNwnqIS+i 20uihdh6DeG0ZMEc1SGJz/d1vkqSmASw9iwN8njitUz5L8lY3w57n9IUQ+iBWhWFBNnIpSokl R9EiiSZmrMihFO+D3GEtPSDK/jU43uzivSD7aEpWqMyJlPcgbdN8Rs8qBr8IvrY7QyVt5MOe5 e0r03NwUax8RJvoccrEknrFfddnHcFVLiha/MJy/7awZp2lZ/NxUM4DIUDrcepNalPtupTHLc Yq3Vxtw5+bNsdpMYAGpe7IfK4Qs2IDjg0D8loi8h0/kEGJmJn6/jAgi46YPqx7Rtc5Exe4EIM MHX9aB+m/Z5p6eQULlZFLcsf8WQWCtsKotzbBCV+7JARJj/+/Q= Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Tue, 26 Sep 2017 17:30:06 +0200 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/clk/clk-mux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c index 1746dbf2f7ea..39cabe157163 100644 --- a/drivers/clk/clk-mux.c +++ b/drivers/clk/clk-mux.c @@ -134,7 +134,7 @@ struct clk_hw *clk_hw_register_mux_table(struct device *dev, const char *name, } /* allocate the mux */ - mux = kzalloc(sizeof(struct clk_mux), GFP_KERNEL); + mux = kzalloc(sizeof(*mux), GFP_KERNEL); if (!mux) return ERR_PTR(-ENOMEM);