[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdUTLYn=14RzJORp1mn-TSwC1rk1BO_9L6TG4g9JhH27JA@mail.gmail.com>
Date: Mon, 22 Nov 2021 08:50:26 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Wolfram Sang <wsa+renesas@...g-engineering.com>,
Biju Das <biju.das.jz@...renesas.com>,
linux-renesas-soc@...r.kernel.org, linux-kernel@...r.kernel.org,
llvm@...ts.linux.dev, Prabhakar <prabhakar.csengg@...il.com>
Subject: Re: [PATCH] memory: renesas-rpc-if: Silence clang warning
Hi Prabhakar,
On Sun, Nov 21, 2021 at 7:05 PM Lad Prabhakar
<prabhakar.mahadev-lad.rj@...renesas.com> wrote:
> This patch silences the following clang warning:
>
> | drivers/memory/renesas-rpc-if.c:253:14: warning: cast to smaller integer
> | type 'enum rpcif_type' from 'const void *' [-Wvoid-pointer-to-enum-cast]
> | rpc->type = (enum rpcif_type)of_device_get_match_data(dev);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Fixes: b04cc0d912eb8 ("memory: renesas-rpc-if: Add support for RZ/G2L")
> Reported-by: kernel test robot <lkp@...el.com>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@...der.be>
> --- a/drivers/memory/renesas-rpc-if.c
> +++ b/drivers/memory/renesas-rpc-if.c
> @@ -250,7 +250,7 @@ int rpcif_sw_init(struct rpcif *rpc, struct device *dev)
> return PTR_ERR(rpc->dirmap);
> rpc->size = resource_size(res);
>
> - rpc->type = (enum rpcif_type)of_device_get_match_data(dev);
> + rpc->type = (enum rpcif_type)(uintptr_t)of_device_get_match_data(dev);
While correct, the cast to "enum rpcif_type" is not stricly needed anymore.
> rpc->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
>
> return PTR_ERR_OR_ZERO(rpc->rstc);
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists