From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752417AbbL1KXJ (ORCPT ); Mon, 28 Dec 2015 05:23:09 -0500 Received: from conuserg009.nifty.com ([202.248.44.35]:46760 "EHLO conuserg009-v.nifty.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752128AbbL1KW6 (ORCPT ); Mon, 28 Dec 2015 05:22:58 -0500 X-Nifty-SrcIP: [153.142.97.90] From: Masahiro Yamada To: linux-clk@vger.kernel.org Cc: Masahiro Yamada , Stephen Boyd , Michael Turquette , linux-kernel@vger.kernel.org Subject: [RESEND PATCH v2 05/16] clk: change sizeof(struct clk *) to sizeof(*core->parents) Date: Mon, 28 Dec 2015 19:22:59 +0900 Message-Id: <1451298191-30815-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1451298191-30815-1-git-send-email-yamada.masahiro@socionext.com> References: <1451298191-30815-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now, the clock parent is not "struct clk *", but "struct clk_core *". Of course, the size of a pointer is always same, but strictly speaking, sizeof(struct clk *) should be sizeof(struct clk_core *) here. This mismatch happened when we split the structure into struct clk and struct clk_core. For the potential possibility of future renaming, sizeof(*core->parents) would be better. Signed-off-by: Masahiro Yamada --- Changes in v2: None drivers/clk/clk.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 30c0bbc..98745c3 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -1069,7 +1069,7 @@ static int clk_fetch_parent_index(struct clk_core *core, if (!core->parents) { core->parents = kcalloc(core->num_parents, - sizeof(struct clk *), GFP_KERNEL); + sizeof(*core->parents), GFP_KERNEL); if (!core->parents) return -ENOMEM; } @@ -1702,7 +1702,7 @@ static struct clk_core *__clk_init_parent(struct clk_core *core) if (!core->parents) core->parents = - kcalloc(core->num_parents, sizeof(struct clk *), + kcalloc(core->num_parents, sizeof(*core->parents), GFP_KERNEL); ret = clk_core_get_parent_by_index(core, index); @@ -2350,8 +2350,8 @@ static int __clk_core_init(struct clk_core *core) * necessary. */ if (core->num_parents > 1) { - core->parents = kcalloc(core->num_parents, sizeof(struct clk *), - GFP_KERNEL); + core->parents = kcalloc(core->num_parents, + sizeof(*core->parents), GFP_KERNEL); /* * clk_core_lookup returns NULL for parents that have not been * clk_init'd; thus any access to clk->parents[] must check -- 1.9.1