* [PATCH v2] clk: socfpga: fix iomem pointer cast on 64-bit
@ 2021-03-14 11:07 Krzysztof Kozlowski
2021-03-29 19:04 ` Stephen Boyd
2021-04-09 7:26 ` Arnd Bergmann
0 siblings, 2 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2021-03-14 11:07 UTC (permalink / raw)
To: Dinh Nguyen, Michael Turquette, Stephen Boyd, linux-clk, linux-kernel
Cc: Krzysztof Kozlowski
Pointers should be cast with uintptr_t instead of integer. This fixes
warning when compile testing on ARM64:
drivers/clk/socfpga/clk-gate.c: In function ‘socfpga_clk_recalc_rate’:
drivers/clk/socfpga/clk-gate.c:102:7: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
Fixes: b7cec13f082f ("clk: socfpga: Look for the GPIO_DB_CLK by its offset")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Acked-by: Dinh Nguyen <dinguyen@kernel.org>
---
Changes since v1:
1. Add Fixes and Ack.
2. Use uintptr_t (Stephen Boyd).
---
drivers/clk/socfpga/clk-gate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/socfpga/clk-gate.c b/drivers/clk/socfpga/clk-gate.c
index 43ecd507bf83..cf94a12459ea 100644
--- a/drivers/clk/socfpga/clk-gate.c
+++ b/drivers/clk/socfpga/clk-gate.c
@@ -99,7 +99,7 @@ static unsigned long socfpga_clk_recalc_rate(struct clk_hw *hwclk,
val = readl(socfpgaclk->div_reg) >> socfpgaclk->shift;
val &= GENMASK(socfpgaclk->width - 1, 0);
/* Check for GPIO_DB_CLK by its offset */
- if ((int) socfpgaclk->div_reg & SOCFPGA_GPIO_DB_CLK_OFFSET)
+ if ((uintptr_t) socfpgaclk->div_reg & SOCFPGA_GPIO_DB_CLK_OFFSET)
div = val + 1;
else
div = (1 << val);
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] clk: socfpga: fix iomem pointer cast on 64-bit
2021-03-14 11:07 [PATCH v2] clk: socfpga: fix iomem pointer cast on 64-bit Krzysztof Kozlowski
@ 2021-03-29 19:04 ` Stephen Boyd
2021-04-09 7:26 ` Arnd Bergmann
1 sibling, 0 replies; 4+ messages in thread
From: Stephen Boyd @ 2021-03-29 19:04 UTC (permalink / raw)
To: Dinh Nguyen, Krzysztof Kozlowski, Michael Turquette, linux-clk,
linux-kernel
Cc: Krzysztof Kozlowski
Quoting Krzysztof Kozlowski (2021-03-14 04:07:09)
> Pointers should be cast with uintptr_t instead of integer. This fixes
> warning when compile testing on ARM64:
>
> drivers/clk/socfpga/clk-gate.c: In function ‘socfpga_clk_recalc_rate’:
> drivers/clk/socfpga/clk-gate.c:102:7: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
>
> Fixes: b7cec13f082f ("clk: socfpga: Look for the GPIO_DB_CLK by its offset")
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> Acked-by: Dinh Nguyen <dinguyen@kernel.org>
>
> ---
Applied to clk-fixes
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] clk: socfpga: fix iomem pointer cast on 64-bit
2021-03-14 11:07 [PATCH v2] clk: socfpga: fix iomem pointer cast on 64-bit Krzysztof Kozlowski
2021-03-29 19:04 ` Stephen Boyd
@ 2021-04-09 7:26 ` Arnd Bergmann
2021-04-09 17:02 ` Stephen Boyd
1 sibling, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2021-04-09 7:26 UTC (permalink / raw)
To: linux-kernel, Michael Turquette, Stephen Boyd, linux-clk,
Krzysztof Kozlowski, Dinh Nguyen
Cc: Arnd Bergmann
From: Arnd Bergmann <arnd@arndb.de>
On Sun, 14 Mar 2021 12:07:09 +0100, Krzysztof Kozlowski wrote:
> Pointers should be cast with uintptr_t instead of integer. This fixes
> warning when compile testing on ARM64:
>
> drivers/clk/socfpga/clk-gate.c: In function ‘socfpga_clk_recalc_rate’:
> drivers/clk/socfpga/clk-gate.c:102:7: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
I decided to pull that into the arm/drivers branch as well, to avoid the
build regression. Since the same fix is in the clk tree, there will now
be a duplicated commit in the git history, but I prefer that over introducing
warnings.
[1/1] clk: socfpga: fix iomem pointer cast on 64-bit
commit: 36841008059caec9667459a7e126efac6379676b
Arnd
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] clk: socfpga: fix iomem pointer cast on 64-bit
2021-04-09 7:26 ` Arnd Bergmann
@ 2021-04-09 17:02 ` Stephen Boyd
0 siblings, 0 replies; 4+ messages in thread
From: Stephen Boyd @ 2021-04-09 17:02 UTC (permalink / raw)
To: Arnd Bergmann, Dinh Nguyen, Krzysztof Kozlowski,
Michael Turquette, linux-clk, linux-kernel
Cc: Arnd Bergmann
Quoting Arnd Bergmann (2021-04-09 00:26:50)
> From: Arnd Bergmann <arnd@arndb.de>
>
> On Sun, 14 Mar 2021 12:07:09 +0100, Krzysztof Kozlowski wrote:
> > Pointers should be cast with uintptr_t instead of integer. This fixes
> > warning when compile testing on ARM64:
> >
> > drivers/clk/socfpga/clk-gate.c: In function ‘socfpga_clk_recalc_rate’:
> > drivers/clk/socfpga/clk-gate.c:102:7: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
>
> I decided to pull that into the arm/drivers branch as well, to avoid the
> build regression. Since the same fix is in the clk tree, there will now
> be a duplicated commit in the git history, but I prefer that over introducing
> warnings.
>
> [1/1] clk: socfpga: fix iomem pointer cast on 64-bit
> commit: 36841008059caec9667459a7e126efac6379676b
>
Ok. I'm sending it off to Linus now.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-04-09 17:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-14 11:07 [PATCH v2] clk: socfpga: fix iomem pointer cast on 64-bit Krzysztof Kozlowski
2021-03-29 19:04 ` Stephen Boyd
2021-04-09 7:26 ` Arnd Bergmann
2021-04-09 17:02 ` Stephen Boyd
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).