Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030614AbdDTIaB (ORCPT ); Thu, 20 Apr 2017 04:30:01 -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 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-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1170 Lines: 36 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; -- 2.12.2