From patchwork Thu Apr 20 08:29:43 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: 9689883 X-Patchwork-Delegate: sboyd@codeaurora.org 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 035CD600C8 for ; Thu, 20 Apr 2017 08:30:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7D8028448 for ; Thu, 20 Apr 2017 08:30:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DCD8F2845B; Thu, 20 Apr 2017 08:30:17 +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 9A52128448 for ; Thu, 20 Apr 2017 08:30:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967518AbdDTI37 (ORCPT ); Thu, 20 Apr 2017 04:29:59 -0400 Received: from mout.web.de ([212.227.15.3]:54901 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967467AbdDTI3u (ORCPT ); Thu, 20 Apr 2017 04:29:50 -0400 Received: from [192.168.1.2] ([77.182.247.81]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LzKJV-1bxPmj3dIH-014TNd; Thu, 20 Apr 2017 10:29:44 +0200 Subject: [PATCH 6/8] clk: Improve a size determination in two functions From: SF Markus Elfring To: linux-clk@vger.kernel.org, Michael Turquette , Stephen Boyd Cc: LKML , kernel-janitors@vger.kernel.org References: <94b24eaa-c5fb-80ea-441a-883989d14ef5@users.sourceforge.net> Message-ID: <599640c0-d9a1-f1a4-47f3-edaf98f407c1@users.sourceforge.net> Date: Thu, 20 Apr 2017 10:29:43 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <94b24eaa-c5fb-80ea-441a-883989d14ef5@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:NXQI4kq2aZPXc8c6eS3W96ZVWuNh2f7djWu6AYFONIfYJWkGk7M 0+d2ylwNz+B+Fj5h6b8MswU0aoVJVtzwjSff4K7j7PG25ZtQhCb4sgwz0mUPekKraoe/G1Q 6CRkSEb7aWUCfL1NIaIOoM6XBsJKGju3UPXu/yam+gfQNYIxSR8CMeAOWsDdfZfWLROFyg0 WDY5dL8SzoYayL2+5ZcRw== X-UI-Out-Filterresults: notjunk:1; V01:K0:R/ITZLLpLGY=:V9Lqdr+YbXa0n3QtL6kc3R oTML6m2sdXW/bkIi/eBdjSIU0v0OlY424BSDKIb6bh/8rvkHvtydMve9DFdgRwrW4/dMezvoA qdBTaKJwKY/il5iR7d4kmU0vi2DK4h1g1X9nR6zeHgYKrl+VmABsZ9t9hfgTRCVnovh6Cq6IB tYjoIPv2CkQKTQrhQy1amBS/RdNPmqGDtM72Dhw+GIt86XJNEfzFsuxqv9UKrCRyzDbI6M/xp Zq5rMhtfjq7Ks/CLKAiV92Qy8JW17LC5qjhaYS1Z4kTT27DcwNMkbHb5AN1XWTs+kpGX/3ZVq 6EMrtYtjQOtRVS02CxWV0VmmwKaDc0CN/MBJ6+o0TrVEuZgFb1aY2f0vLotHdf5arIer+dSnA wiJ/sah1ij4e8JqlY765Hfi9bykd+V4o34L5cH2JpGj+1w286Xd+qOHERGZ4IiZKnnuBwnoew xyzclKb/zkg/UquBOsYIosHGQw1XKQn3KEQ4wy8DNlj3ydBersUrDjLQ0zEUkJPQSiKG1RlZO Rs7CIirTGOnYYBf3MP1q0N3vHocH+L3yTSJ4B4nnFCmXuhzYYfRNZxySA75QDMN8rkYaNp03h a8wG1NS3rEwO2uuXSEen2ZUFjD+J3sHP7hWdb4PUZ6dBwXAQyFUndzUgYHRnWG1B2x9UUqbQe 6o08tdSxpGKdOCY3j6fPh5/enyMnsBs+lVho1PnmACj/orQ5NsGZgjpLiyT7r/2XrI1ZTdG8+ GRmCI+TqfJJgMnflp9I7RttawcUNIiQADU5dq/gnN+H4IaBDLXIVRy1NtqzOMB0IUwk4hIAM6 JhpLqTp 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: Thu, 20 Apr 2017 09:30:52 +0200 Replace the specification of two data structures by pointer dereferences as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. Signed-off-by: Markus Elfring --- drivers/clk/clk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 684642ab4212..3f2ee0469d3e 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -2939,7 +2939,7 @@ int clk_notifier_register(struct clk *clk, struct notifier_block *nb) /* if clk wasn't in the notifier list, allocate new clk_notifier */ if (cn->clk != clk) { - cn = kzalloc(sizeof(struct clk_notifier), GFP_KERNEL); + cn = kzalloc(sizeof(*cn), GFP_KERNEL); if (!cn) goto out; @@ -3087,7 +3087,7 @@ int of_clk_add_provider(struct device_node *np, struct of_clk_provider *cp; int ret; - cp = kzalloc(sizeof(struct of_clk_provider), GFP_KERNEL); + cp = kzalloc(sizeof(*cp), GFP_KERNEL); if (!cp) return -ENOMEM;