From patchwork Thu Sep 15 15:45:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9334117 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 0AE0C607FD for ; Thu, 15 Sep 2016 15:46:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00655299C9 for ; Thu, 15 Sep 2016 15:46:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E811C299D7; Thu, 15 Sep 2016 15:46:58 +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.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 53D81299C9 for ; Thu, 15 Sep 2016 15:46:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751302AbcIOPq5 (ORCPT ); Thu, 15 Sep 2016 11:46:57 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:58217 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751085AbcIOPq4 (ORCPT ); Thu, 15 Sep 2016 11:46:56 -0400 Received: from wuerfel.lan. ([78.43.20.153]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0LvBGU-1b1qBC418E-010MOb; Thu, 15 Sep 2016 17:46:21 +0200 From: Arnd Bergmann To: Michael Turquette , Stephen Boyd Cc: Arnd Bergmann , Jun Nie , linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] clk: zx: fix pointer case warnings Date: Thu, 15 Sep 2016 17:45:57 +0200 Message-Id: <20160915154618.3007024-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:A+xTUAdOVvDIbsnGy53BlfdzRtMQmIkMRtbts3LHeaY6oxPSXPx 80JeMxDB/EZN1CkJbe2UH074wcmmeyO0XPgPZHuzQMelvNBtsMj62qLxFbHakTqaB04+pXP Xhs+OCRSTCzSJqt8qdpl1DBVYCUfn9Tt69+wUlBMaJLH4zNKhtZX8Qcdovh0Lp1un19YzJS zk6f/+duDjnLVpaDhiCVg== X-UI-Out-Filterresults: notjunk:1; V01:K0:UAn8KEXn+Y0=:MnP2BK30bZ/TwXZsmgX4KA 7klKMX/4fQ32vlsYQDGHpkNiFwgfxby0DCUWs6an53cYTwZeKY4T9fLlm3ueAkJdy9Yoi+II2 JoDBwjBQJi2/6gUP81ScuKag0yDmNoVUdOJbK7CA72jNcyX3KPulLAR0+W1UB/GgmSioQZ0Xp 9PnUED63jWIO6dND8rNqOYDzStHCnVt6frQOy3xu/5EdXBsFFrvRiHbXSBSgF1ORPzB0AKtjh 3Wh37z0ic2x9KDkjBuvKupV9XiMui6pNjlcoA0JbInhbjB6L1I23kCNI91b8NZK6dmNITq07W GQjLkurHE7fUVTiONGSaZba4d91xLkblMx43ENlgpRCnPQeqm1+RrN02WFYRpN+2YT8hiwMzp YJWPtjadXOPOEdUd6GerrIZRi5/7LUY+MwF9y+U5Kq0dqBSTL8nejDWGDjFbrKOM5WT3+kBr2 geWuBwVy7PSwiiKUGt8USGiUh3lQfeoWK7847moV8kx30AfEwUlbiyvZY6i57ktT+8fPtNVNW 2GNI/qdJrCNQOSgtg7lcG0bJiEdpCtSimGgIw3QEDKGKwuBcCBXjCVYg9ofsNpZJBxz09adep PYxWgasA2zxgEe6BXUAhsiKoY/TWMIG5VVH7i7QpJ8wAowrhXDFE/uYMianpEqS5rfVQ+Zm/D B6bsA2ogcXShYfjrHpn6X6AQon0/Kvax5mCOIwm6xBBoJ1atJl4WAVBqC9kn2jGDnXMc= 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 The zx296718 clock driver has a creative way of assigning the register values for each clock, by initializing an __iomem pointer to an offset and then later adding the base (from ioremap) on top with a cast to u64. This fail on all 32-bit architectures during compile testing: drivers/clk/zte/clk-zx296718.c: In function 'top_clocks_init': drivers/clk/zte/clk-zx296718.c:554:35: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] zx296718_pll_clk[i].reg_base += (u64)reg_base; drivers/clk/zte/clk-zx296718.c:579:29: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] drivers/clk/zte/clk-zx296718.c:592:31: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] It would be nice to avoid all the casts, but I decided to simply shut up the warnings by changing the type from u64 to uintptr_t, which does the right thing in practice. Signed-off-by: Arnd Bergmann Fixes: ca0233285a93 ("clk: zx: register ZX296718 clocks") --- drivers/clk/zte/clk-zx296718.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/clk/zte/clk-zx296718.c b/drivers/clk/zte/clk-zx296718.c index 025e324fab5c..b34402d0cd69 100644 --- a/drivers/clk/zte/clk-zx296718.c +++ b/drivers/clk/zte/clk-zx296718.c @@ -551,7 +551,7 @@ static int __init top_clocks_init(struct device_node *np) } for (i = 0; i < ARRAY_SIZE(zx296718_pll_clk); i++) { - zx296718_pll_clk[i].reg_base += (u64)reg_base; + zx296718_pll_clk[i].reg_base += (uintptr_t)reg_base; ret = clk_hw_register(NULL, &zx296718_pll_clk[i].hw); if (ret) { pr_warn("top clk %s init error!\n", @@ -576,7 +576,7 @@ static int __init top_clocks_init(struct device_node *np) top_hw_onecell_data.hws[top_mux_clk[i].id] = &top_mux_clk[i].mux.hw; - top_mux_clk[i].mux.reg += (u64)reg_base; + top_mux_clk[i].mux.reg += (uintptr_t)reg_base; ret = clk_hw_register(NULL, &top_mux_clk[i].mux.hw); if (ret) { pr_warn("top clk %s init error!\n", @@ -589,7 +589,7 @@ static int __init top_clocks_init(struct device_node *np) top_hw_onecell_data.hws[top_gate_clk[i].id] = &top_gate_clk[i].gate.hw; - top_gate_clk[i].gate.reg += (u64)reg_base; + top_gate_clk[i].gate.reg += (uintptr_t)reg_base; ret = clk_hw_register(NULL, &top_gate_clk[i].gate.hw); if (ret) { pr_warn("top clk %s init error!\n", @@ -602,7 +602,7 @@ static int __init top_clocks_init(struct device_node *np) top_hw_onecell_data.hws[top_div_clk[i].id] = &top_div_clk[i].div.hw; - top_div_clk[i].div.reg += (u64)reg_base; + top_div_clk[i].div.reg += (uintptr_t)reg_base; ret = clk_hw_register(NULL, &top_div_clk[i].div.hw); if (ret) { pr_warn("top clk %s init error!\n", @@ -742,7 +742,7 @@ static int __init lsp0_clocks_init(struct device_node *np) lsp0_hw_onecell_data.hws[lsp0_mux_clk[i].id] = &lsp0_mux_clk[i].mux.hw; - lsp0_mux_clk[i].mux.reg += (u64)reg_base; + lsp0_mux_clk[i].mux.reg += (uintptr_t)reg_base; ret = clk_hw_register(NULL, &lsp0_mux_clk[i].mux.hw); if (ret) { pr_warn("lsp0 clk %s init error!\n", @@ -755,7 +755,7 @@ static int __init lsp0_clocks_init(struct device_node *np) lsp0_hw_onecell_data.hws[lsp0_gate_clk[i].id] = &lsp0_gate_clk[i].gate.hw; - lsp0_gate_clk[i].gate.reg += (u64)reg_base; + lsp0_gate_clk[i].gate.reg += (uintptr_t)reg_base; ret = clk_hw_register(NULL, &lsp0_gate_clk[i].gate.hw); if (ret) { pr_warn("lsp0 clk %s init error!\n", @@ -768,7 +768,7 @@ static int __init lsp0_clocks_init(struct device_node *np) lsp0_hw_onecell_data.hws[lsp0_div_clk[i].id] = &lsp0_div_clk[i].div.hw; - lsp0_div_clk[i].div.reg += (u64)reg_base; + lsp0_div_clk[i].div.reg += (uintptr_t)reg_base; ret = clk_hw_register(NULL, &lsp0_div_clk[i].div.hw); if (ret) { pr_warn("lsp0 clk %s init error!\n", @@ -847,7 +847,7 @@ static int __init lsp1_clocks_init(struct device_node *np) lsp1_hw_onecell_data.hws[lsp1_mux_clk[i].id] = &lsp0_mux_clk[i].mux.hw; - lsp1_mux_clk[i].mux.reg += (u64)reg_base; + lsp1_mux_clk[i].mux.reg += (uintptr_t)reg_base; ret = clk_hw_register(NULL, &lsp1_mux_clk[i].mux.hw); if (ret) { pr_warn("lsp1 clk %s init error!\n", @@ -860,7 +860,7 @@ static int __init lsp1_clocks_init(struct device_node *np) lsp1_hw_onecell_data.hws[lsp1_gate_clk[i].id] = &lsp1_gate_clk[i].gate.hw; - lsp1_gate_clk[i].gate.reg += (u64)reg_base; + lsp1_gate_clk[i].gate.reg += (uintptr_t)reg_base; ret = clk_hw_register(NULL, &lsp1_gate_clk[i].gate.hw); if (ret) { pr_warn("lsp1 clk %s init error!\n", @@ -873,7 +873,7 @@ static int __init lsp1_clocks_init(struct device_node *np) lsp1_hw_onecell_data.hws[lsp1_div_clk[i].id] = &lsp1_div_clk[i].div.hw; - lsp1_div_clk[i].div.reg += (u64)reg_base; + lsp1_div_clk[i].div.reg += (uintptr_t)reg_base; ret = clk_hw_register(NULL, &lsp1_div_clk[i].div.hw); if (ret) { pr_warn("lsp1 clk %s init error!\n",