From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934955AbcIPXSj (ORCPT ); Fri, 16 Sep 2016 19:18:39 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:46921 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934452AbcIPXSS (ORCPT ); Fri, 16 Sep 2016 19:18:18 -0400 DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 518BD617C6 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=sboyd@codeaurora.org Date: Fri, 16 Sep 2016 16:18:16 -0700 From: Stephen Boyd To: Arnd Bergmann Cc: Michael Turquette , Jun Nie , linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] clk: zx: fix pointer case warnings Message-ID: <20160916231816.GZ7243@codeaurora.org> References: <20160915154618.3007024-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160915154618.3007024-1-arnd@arndb.de> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/15, Arnd Bergmann wrote: > 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. Thanks. I usually push people to have descriptor structures that they use to create these things at runtime but that isn't working out so great all the time and we don't really have a precedent for one way or the other. This will work for now. Applied to clk-next. -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project